-
-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor casts, removing SLBOOL and PTRBOOL.
- Loading branch information
Showing
5 changed files
with
36 additions
and
15 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
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,25 @@ | ||
// #target: macos-x64 | ||
module test; | ||
fn void main() | ||
{ | ||
int xd; | ||
void*[<2>] x = { &xd, null }; | ||
bool[<2>] y = (bool[<2>])x; | ||
} | ||
|
||
/* #expect: test.ll | ||
|
||
entry: | ||
%xd = alloca i32, align 4 | ||
%x = alloca <2 x ptr>, align 16 | ||
%y = alloca <2 x i8>, align 2 | ||
store i32 0, ptr %xd, align 4 | ||
%0 = insertelement <2 x ptr> undef, ptr %xd, i64 0 | ||
%1 = insertelement <2 x ptr> %0, ptr null, i64 1 | ||
store <2 x ptr> %1, ptr %x, align 16 | ||
%2 = load <2 x ptr>, ptr %x, align 16 | ||
%i2b = icmp ne <2 x ptr> %2, zeroinitializer | ||
%3 = sext <2 x i1> %i2b to <2 x i8> | ||
store <2 x i8> %3, ptr %y, align 2 | ||
ret void | ||
} |