-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cgen: add
asm
to c_reserved, fixes compilation of `struct Abc { @asm …
…int }` (#22340)
- Loading branch information
Showing
2 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
struct Abc { | ||
@asm string | ||
} | ||
|
||
enum Enum { | ||
@asm | ||
end | ||
} | ||
|
||
fn test_struct() { | ||
dump(Abc{}) | ||
assert true | ||
} | ||
|
||
fn test_local() { | ||
@asm := 12 | ||
dump(@asm) | ||
assert true | ||
} | ||
|
||
fn test_enum() { | ||
dump(unsafe { Enum(0) }) | ||
dump(Enum.@asm) | ||
dump(Enum.end) | ||
assert true | ||
} |