-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Assertion failed when casting argument to enum #1196
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 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
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,27 @@ | ||
// #target: macos-x64 | ||
module test; | ||
enum Abc : char { ABC } | ||
|
||
enum Mouse_Button { | ||
LEFT, | ||
RIGHT, | ||
MIDDLE, | ||
} | ||
|
||
fn void foo(Mouse_Button button) | ||
{ | ||
} | ||
|
||
fn int main() { | ||
uint x = 1; | ||
foo((Mouse_Button)x); | ||
return 0; | ||
} | ||
|
||
/* #expect: test.ll | ||
|
||
%x = alloca i32, align 4 | ||
store i32 1, ptr %x, align 4 | ||
%0 = load i32, ptr %x, align 4 | ||
call void @test.foo(i32 %0) | ||
ret i32 0 |