summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-26 08:25:06 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-26 08:25:06 +0000
commite3ff5ada8a8f6cc166ecc45147da0d63c3683026 (patch)
treeccd4a6b0d605384b41f7d3b84cc019344c2dd65a /test/Transforms/InstCombine
parent950bf6030101d670ea205efd307ea5d3b375544d (diff)
downloadllvm-e3ff5ada8a8f6cc166ecc45147da0d63c3683026.tar.gz
llvm-e3ff5ada8a8f6cc166ecc45147da0d63c3683026.tar.bz2
llvm-e3ff5ada8a8f6cc166ecc45147da0d63c3683026.tar.xz
For PR761:
Remove "target endian/pointersize" or add "target datalayout" to make the test parse properly or set the datalayout because defaults changes. For PR645: Make global names use the @ prefix. For llvm-upgrade changes: Fix test cases or completely remove use of llvm-upgrade for test cases that cannot survive the new renaming or upgrade capabilities. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33533 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r--test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll2
-rw-r--r--test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll4
-rw-r--r--test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll2
-rw-r--r--test/Transforms/InstCombine/IntPtrCast.ll1
-rw-r--r--test/Transforms/InstCombine/add.ll8
-rw-r--r--test/Transforms/InstCombine/cast-malloc.ll7
-rw-r--r--test/Transforms/InstCombine/sub.ll2
-rw-r--r--test/Transforms/InstCombine/vec_shuffle.ll14
-rw-r--r--test/Transforms/InstCombine/xor.ll12
-rw-r--r--test/Transforms/InstCombine/zeroext-and-reduce.ll2
10 files changed, 30 insertions, 24 deletions
diff --git a/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll b/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll
index 0add14bf24..a5ee87b9ef 100644
--- a/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll
+++ b/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll
@@ -1,7 +1,7 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep zext
; PR1107
-define i1 %test(i8 %A, i8 %B) {
+define i1 @test(i8 %A, i8 %B) {
%a = zext i8 %A to i32
%b = zext i8 %B to i32
%c = icmp sgt i32 %a, %b
diff --git a/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll b/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll
index 3b34a7db9d..6d27d4544d 100644
--- a/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll
+++ b/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll
@@ -1,6 +1,6 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'fcmp uno.*0.0'
; PR1111
-define i1 %test(double %X) {
-%tmp = fcmp une double %X, %X
+define i1 @test(double %X) {
+ %tmp = fcmp une double %X, %X
ret i1 %tmp
}
diff --git a/test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll b/test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll
index 0aa2022829..83d05d9d94 100644
--- a/test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll
+++ b/test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll
@@ -1,6 +1,6 @@
; RUN: llvm-as < %s | opt -instcombine -disable-output
-define <4 x i32> %test(<4 x i32> %A) {
+define <4 x i32> @test(<4 x i32> %A) {
%B = xor <4 x i32> %A, < i32 -1, i32 -1, i32 -1, i32 -1 >
%C = and <4 x i32> %B, < i32 -1, i32 -1, i32 -1, i32 -1 >
ret <4 x i32> %C
diff --git a/test/Transforms/InstCombine/IntPtrCast.ll b/test/Transforms/InstCombine/IntPtrCast.ll
index 9f509b6fbc..7ff71c86b7 100644
--- a/test/Transforms/InstCombine/IntPtrCast.ll
+++ b/test/Transforms/InstCombine/IntPtrCast.ll
@@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | notcast
+target endian = little
target pointersize = 32
int *%test(int *%P) {
diff --git a/test/Transforms/InstCombine/add.ll b/test/Transforms/InstCombine/add.ll
index ec3aea3c87..033743c64f 100644
--- a/test/Transforms/InstCombine/add.ll
+++ b/test/Transforms/InstCombine/add.ll
@@ -241,9 +241,9 @@ ubyte %test34(ubyte %A) {
ret ubyte %C
}
-i32 %test34(i32 %a) { ;; -> -1
- %tmpnot = xor i32 %a, -1
- %tmp2 = add i32 %tmpnot, %a
- ret i32 %tmp2
+int %test34(int %a) { ;; -> -1
+ %tmpnot = xor int %a, -1
+ %tmp2 = add int %tmpnot, %a
+ ret int %tmp2
}
diff --git a/test/Transforms/InstCombine/cast-malloc.ll b/test/Transforms/InstCombine/cast-malloc.ll
index 2458bf3ea4..e863197a98 100644
--- a/test/Transforms/InstCombine/cast-malloc.ll
+++ b/test/Transforms/InstCombine/cast-malloc.ll
@@ -1,6 +1,11 @@
; test that casted mallocs get converted to malloc of the right type
-; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep bitcast
+; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
+; RUN: not grep bitcast
+; The target datalayout is important for this test case. We have to tell
+; instcombine that the ABI alignment for a long is 4-bytes, not 8, otherwise
+; it won't do the transform.
+target datalayout = "e-l:32:64"
int* %test(uint %size) {
%X = malloc long, uint %size
%ret = bitcast long* %X to int*
diff --git a/test/Transforms/InstCombine/sub.ll b/test/Transforms/InstCombine/sub.ll
index be38da97e1..5d9cab929a 100644
--- a/test/Transforms/InstCombine/sub.ll
+++ b/test/Transforms/InstCombine/sub.ll
@@ -2,7 +2,7 @@
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
-; RUN: grep -v 'sub i32 %Cok.s, %Bok.s' | not grep sub
+; RUN: grep -v 'sub i32 %Cok, %Bok' | not grep sub
implementation
diff --git a/test/Transforms/InstCombine/vec_shuffle.ll b/test/Transforms/InstCombine/vec_shuffle.ll
index e90d3bef61..a8c83afe73 100644
--- a/test/Transforms/InstCombine/vec_shuffle.ll
+++ b/test/Transforms/InstCombine/vec_shuffle.ll
@@ -5,36 +5,36 @@
implementation
-define %T %test1(%T %v1) {
+define %T @test1(%T %v1) {
%v2 = shufflevector %T %v1, %T undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
ret %T %v2
}
-define %T %test2(%T %v1) {
+define %T @test2(%T %v1) {
%v2 = shufflevector %T %v1, %T %v1, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
ret %T %v2
}
-define float %test3(%T %A, %T %B, float %f) {
+define float @test3(%T %A, %T %B, float %f) {
%C = insertelement %T %A, float %f, i32 0
%D = shufflevector %T %C, %T %B, <4 x i32> <i32 5, i32 0, i32 2, i32 7>
%E = extractelement %T %D, i32 1
ret float %E
}
-define i32 %test4(<4 x i32> %X) {
+define i32 @test4(<4 x i32> %X) {
%tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x i32> zeroinitializer
%tmp34 = extractelement <4 x i32> %tmp152.i53899.i, i32 0
ret i32 %tmp34
}
-define i32 %test5(<4 x i32> %X) {
+define i32 @test5(<4 x i32> %X) {
%tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 undef, i32 undef>
%tmp34 = extractelement <4 x i32> %tmp152.i53899.i, i32 0
ret i32 %tmp34
}
-define float %test6(<4 x float> %X) {
+define float @test6(<4 x float> %X) {
%X = bitcast <4 x float> %X to <4 x i32>
%tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x i32> zeroinitializer
%tmp152.i53900.i = bitcast <4 x i32> %tmp152.i53899.i to <4 x float>
@@ -42,7 +42,7 @@ define float %test6(<4 x float> %X) {
ret float %tmp34
}
-define <4 x float> %test7(<4 x float> %tmp45.i) {
+define <4 x float> @test7(<4 x float> %tmp45.i) {
%tmp1642.i = shufflevector <4 x float> %tmp45.i, <4 x float> undef, <4 x i32> < i32 0, i32 1, i32 6, i32 7 >
ret <4 x float> %tmp1642.i
}
diff --git a/test/Transforms/InstCombine/xor.ll b/test/Transforms/InstCombine/xor.ll
index f87e53a922..b6c923d5b4 100644
--- a/test/Transforms/InstCombine/xor.ll
+++ b/test/Transforms/InstCombine/xor.ll
@@ -182,11 +182,11 @@ int %test26(int %a, int %b) {
}
-i32 %test27(i32 %b, i32 %c, i32 %d) {
- %tmp2 = xor i32 %d, %b
- %tmp5 = xor i32 %d, %c
- %tmp = icmp eq i32 %tmp2, %tmp5
- %tmp6 = zext bool %tmp to i32
- ret i32 %tmp6
+int %test27(int %b, int %c, int %d) {
+ %tmp2 = xor int %d, %b
+ %tmp5 = xor int %d, %c
+ %tmp = icmp eq int %tmp2, %tmp5
+ %tmp6 = zext bool %tmp to int
+ ret int %tmp6
}
diff --git a/test/Transforms/InstCombine/zeroext-and-reduce.ll b/test/Transforms/InstCombine/zeroext-and-reduce.ll
index e171f3aacb..a863d55d4c 100644
--- a/test/Transforms/InstCombine/zeroext-and-reduce.ll
+++ b/test/Transforms/InstCombine/zeroext-and-reduce.ll
@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
-; RUN: grep 'and i32 %Y.s, 8'
+; RUN: grep 'and i32 %Y, 8'
int %test1(ubyte %X) {
%Y = cast ubyte %X to int