Index: tests_lit/llvm2ice_tests/convert.ll |
diff --git a/tests_lit/llvm2ice_tests/convert.ll b/tests_lit/llvm2ice_tests/convert.ll |
index 53a1de4391466144a9c7a288655f33338c8571c7..b5655cce411aaa89cedc051f29d1efb94da271f7 100644 |
--- a/tests_lit/llvm2ice_tests/convert.ll |
+++ b/tests_lit/llvm2ice_tests/convert.ll |
@@ -1,29 +1,31 @@ |
; RUIN: %llvm2ice %s | FileCheck %s |
; RUIN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
-; RUN: %szdiff --llvm2ice=%llvm2ice %s | FileCheck --check-prefix=DUMP %s |
+; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s |
+; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ |
+; RUN: | FileCheck --check-prefix=DUMP %s |
-@i8v = common global i8 0, align 1 |
-@i16v = common global i16 0, align 2 |
-@i32v = common global i32 0, align 4 |
-@i64v = common global i64 0, align 8 |
-@u8v = common global i8 0, align 1 |
-@u16v = common global i16 0, align 2 |
-@u32v = common global i32 0, align 4 |
-@u64v = common global i64 0, align 8 |
-@i1 = common global i32 0, align 4 |
-@i2 = common global i32 0, align 4 |
-@u1 = common global i32 0, align 4 |
-@u2 = common global i32 0, align 4 |
+@i8v = global [1 x i8] zeroinitializer, align 1 |
+@i16v = global [2 x i8] zeroinitializer, align 2 |
+@i32v = global [4 x i8] zeroinitializer, align 4 |
+@i64v = global [8 x i8] zeroinitializer, align 8 |
+@u8v = global [1 x i8] zeroinitializer, align 1 |
+@u16v = global [2 x i8] zeroinitializer, align 2 |
+@u32v = global [4 x i8] zeroinitializer, align 4 |
+@u64v = global [8 x i8] zeroinitializer, align 8 |
define void @from_int8() { |
entry: |
- %v0 = load i8* @i8v, align 1 |
+ %__0 = bitcast [1 x i8]* @i8v to i8* |
+ %v0 = load i8* %__0, align 1 |
%v1 = sext i8 %v0 to i16 |
- store i16 %v1, i16* @i16v, align 1 |
+ %__3 = bitcast [2 x i8]* @i16v to i16* |
+ store i16 %v1, i16* %__3, align 1 |
%v2 = sext i8 %v0 to i32 |
- store i32 %v2, i32* @i32v, align 1 |
+ %__5 = bitcast [4 x i8]* @i32v to i32* |
+ store i32 %v2, i32* %__5, align 1 |
%v3 = sext i8 %v0 to i64 |
- store i64 %v3, i64* @i64v, align 1 |
+ %__7 = bitcast [8 x i8]* @i64v to i64* |
+ store i64 %v3, i64* %__7, align 1 |
ret void |
; CHECK: mov al, byte ptr [ |
; CHECK-NEXT: movsx cx, al |
@@ -38,13 +40,17 @@ entry: |
define void @from_int16() { |
entry: |
- %v0 = load i16* @i16v, align 1 |
+ %__0 = bitcast [2 x i8]* @i16v to i16* |
+ %v0 = load i16* %__0, align 1 |
%v1 = trunc i16 %v0 to i8 |
- store i8 %v1, i8* @i8v, align 1 |
+ %__3 = bitcast [1 x i8]* @i8v to i8* |
+ store i8 %v1, i8* %__3, align 1 |
%v2 = sext i16 %v0 to i32 |
- store i32 %v2, i32* @i32v, align 1 |
+ %__5 = bitcast [4 x i8]* @i32v to i32* |
+ store i32 %v2, i32* %__5, align 1 |
%v3 = sext i16 %v0 to i64 |
- store i64 %v3, i64* @i64v, align 1 |
+ %__7 = bitcast [8 x i8]* @i64v to i64* |
+ store i64 %v3, i64* %__7, align 1 |
ret void |
; CHECK: mov ax, word ptr [ |
; CHECK-NEXT: mov cx, ax |
@@ -59,13 +65,17 @@ entry: |
define void @from_int32() { |
entry: |
- %v0 = load i32* @i32v, align 1 |
+ %__0 = bitcast [4 x i8]* @i32v to i32* |
+ %v0 = load i32* %__0, align 1 |
%v1 = trunc i32 %v0 to i8 |
- store i8 %v1, i8* @i8v, align 1 |
+ %__3 = bitcast [1 x i8]* @i8v to i8* |
+ store i8 %v1, i8* %__3, align 1 |
%v2 = trunc i32 %v0 to i16 |
- store i16 %v2, i16* @i16v, align 1 |
+ %__5 = bitcast [2 x i8]* @i16v to i16* |
+ store i16 %v2, i16* %__5, align 1 |
%v3 = sext i32 %v0 to i64 |
- store i64 %v3, i64* @i64v, align 1 |
+ %__7 = bitcast [8 x i8]* @i64v to i64* |
+ store i64 %v3, i64* %__7, align 1 |
ret void |
; CHECK: mov eax, dword ptr [ |
; CHECK-NEXT: mov ecx, eax |
@@ -80,13 +90,17 @@ entry: |
define void @from_int64() { |
entry: |
- %v0 = load i64* @i64v, align 1 |
+ %__0 = bitcast [8 x i8]* @i64v to i64* |
+ %v0 = load i64* %__0, align 1 |
%v1 = trunc i64 %v0 to i8 |
- store i8 %v1, i8* @i8v, align 1 |
+ %__3 = bitcast [1 x i8]* @i8v to i8* |
+ store i8 %v1, i8* %__3, align 1 |
%v2 = trunc i64 %v0 to i16 |
- store i16 %v2, i16* @i16v, align 1 |
+ %__5 = bitcast [2 x i8]* @i16v to i16* |
+ store i16 %v2, i16* %__5, align 1 |
%v3 = trunc i64 %v0 to i32 |
- store i32 %v3, i32* @i32v, align 1 |
+ %__7 = bitcast [4 x i8]* @i32v to i32* |
+ store i32 %v3, i32* %__7, align 1 |
ret void |
; CHECK: mov eax, dword ptr [ |
; CHECK-NEXT: mov ecx, eax |
@@ -98,13 +112,17 @@ entry: |
define void @from_uint8() { |
entry: |
- %v0 = load i8* @u8v, align 1 |
+ %__0 = bitcast [1 x i8]* @u8v to i8* |
+ %v0 = load i8* %__0, align 1 |
%v1 = zext i8 %v0 to i16 |
- store i16 %v1, i16* @i16v, align 1 |
+ %__3 = bitcast [2 x i8]* @i16v to i16* |
+ store i16 %v1, i16* %__3, align 1 |
%v2 = zext i8 %v0 to i32 |
- store i32 %v2, i32* @i32v, align 1 |
+ %__5 = bitcast [4 x i8]* @i32v to i32* |
+ store i32 %v2, i32* %__5, align 1 |
%v3 = zext i8 %v0 to i64 |
- store i64 %v3, i64* @i64v, align 1 |
+ %__7 = bitcast [8 x i8]* @i64v to i64* |
+ store i64 %v3, i64* %__7, align 1 |
ret void |
; CHECK: mov al, byte ptr [ |
; CHECK-NEXT: movzx cx, al |
@@ -119,13 +137,17 @@ entry: |
define void @from_uint16() { |
entry: |
- %v0 = load i16* @u16v, align 1 |
+ %__0 = bitcast [2 x i8]* @u16v to i16* |
+ %v0 = load i16* %__0, align 1 |
%v1 = trunc i16 %v0 to i8 |
- store i8 %v1, i8* @i8v, align 1 |
+ %__3 = bitcast [1 x i8]* @i8v to i8* |
+ store i8 %v1, i8* %__3, align 1 |
%v2 = zext i16 %v0 to i32 |
- store i32 %v2, i32* @i32v, align 1 |
+ %__5 = bitcast [4 x i8]* @i32v to i32* |
+ store i32 %v2, i32* %__5, align 1 |
%v3 = zext i16 %v0 to i64 |
- store i64 %v3, i64* @i64v, align 1 |
+ %__7 = bitcast [8 x i8]* @i64v to i64* |
+ store i64 %v3, i64* %__7, align 1 |
ret void |
; CHECK: mov ax, word ptr [ |
; CHECK-NEXT: mov cx, ax |
@@ -140,13 +162,17 @@ entry: |
define void @from_uint32() { |
entry: |
- %v0 = load i32* @u32v, align 1 |
+ %__0 = bitcast [4 x i8]* @u32v to i32* |
+ %v0 = load i32* %__0, align 1 |
%v1 = trunc i32 %v0 to i8 |
- store i8 %v1, i8* @i8v, align 1 |
+ %__3 = bitcast [1 x i8]* @i8v to i8* |
+ store i8 %v1, i8* %__3, align 1 |
%v2 = trunc i32 %v0 to i16 |
- store i16 %v2, i16* @i16v, align 1 |
+ %__5 = bitcast [2 x i8]* @i16v to i16* |
+ store i16 %v2, i16* %__5, align 1 |
%v3 = zext i32 %v0 to i64 |
- store i64 %v3, i64* @i64v, align 1 |
+ %__7 = bitcast [8 x i8]* @i64v to i64* |
+ store i64 %v3, i64* %__7, align 1 |
ret void |
; CHECK: mov eax, dword ptr [ |
; CHECK-NEXT: mov ecx, eax |
@@ -160,13 +186,17 @@ entry: |
define void @from_uint64() { |
entry: |
- %v0 = load i64* @u64v, align 1 |
+ %__0 = bitcast [8 x i8]* @u64v to i64* |
+ %v0 = load i64* %__0, align 1 |
%v1 = trunc i64 %v0 to i8 |
- store i8 %v1, i8* @i8v, align 1 |
+ %__3 = bitcast [1 x i8]* @i8v to i8* |
+ store i8 %v1, i8* %__3, align 1 |
%v2 = trunc i64 %v0 to i16 |
- store i16 %v2, i16* @i16v, align 1 |
+ %__5 = bitcast [2 x i8]* @i16v to i16* |
+ store i16 %v2, i16* %__5, align 1 |
%v3 = trunc i64 %v0 to i32 |
- store i32 %v3, i32* @i32v, align 1 |
+ %__7 = bitcast [4 x i8]* @i32v to i32* |
+ store i32 %v3, i32* %__7, align 1 |
ret void |
; CHECK: mov eax, dword ptr [ |
; CHECK-NEXT: mov ecx, eax |