OSDN Git Service

Move thumb and thumb2 tests into separate directories.
authorEvan Cheng <evan.cheng@apple.com>
Wed, 24 Jun 2009 06:36:07 +0000 (06:36 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 24 Jun 2009 06:36:07 +0000 (06:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74068 91177308-0d34-0410-b5e6-96231b3b80d8

44 files changed:
test/CodeGen/ARM/dyn-stackalloc.ll
test/CodeGen/ARM/fpconv.ll
test/CodeGen/ARM/fpow.ll
test/CodeGen/ARM/frame_thumb.ll [deleted file]
test/CodeGen/ARM/iabs.ll
test/CodeGen/ARM/ispositive.ll
test/CodeGen/ARM/large-stack.ll
test/CodeGen/ARM/ldr_ext.ll
test/CodeGen/ARM/ldr_frame.ll
test/CodeGen/ARM/long-setcc.ll
test/CodeGen/ARM/long.ll
test/CodeGen/ARM/long_shift.ll
test/CodeGen/ARM/mul.ll
test/CodeGen/ARM/select.ll
test/CodeGen/ARM/stack-frame.ll
test/CodeGen/ARM/tst_teq.ll
test/CodeGen/ARM/unord.ll
test/CodeGen/Thumb/2007-01-31-RegInfoAssert.ll [moved from test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll with 100% similarity]
test/CodeGen/Thumb/2007-02-02-JoinIntervalsCrash.ll [moved from test/CodeGen/ARM/2007-02-02-JoinIntervalsCrash.ll with 100% similarity]
test/CodeGen/Thumb/2007-03-06-AddR7.ll [moved from test/CodeGen/ARM/2007-03-06-AddR7.ll with 100% similarity]
test/CodeGen/Thumb/2007-05-05-InvalidPushPop.ll [moved from test/CodeGen/ARM/2007-05-05-InvalidPushPop.ll with 100% similarity]
test/CodeGen/Thumb/2009-06-18-ThumbCommuteMul.ll [moved from test/CodeGen/ARM/2009-06-18-ThumbCommuteMul.ll with 100% similarity]
test/CodeGen/Thumb/dyn-stackalloc.ll [new file with mode: 0644]
test/CodeGen/Thumb/fpconv.ll [new file with mode: 0644]
test/CodeGen/Thumb/fpow.ll [new file with mode: 0644]
test/CodeGen/Thumb/frame_thumb.ll [new file with mode: 0644]
test/CodeGen/Thumb/iabs.ll [new file with mode: 0644]
test/CodeGen/Thumb/inlineasm-imm-thumb.ll [moved from test/CodeGen/ARM/inlineasm-imm-thumb.ll with 100% similarity]
test/CodeGen/Thumb/ispositive.ll [new file with mode: 0644]
test/CodeGen/Thumb/large-stack.ll [new file with mode: 0644]
test/CodeGen/Thumb/ldr_ext.ll [new file with mode: 0644]
test/CodeGen/Thumb/ldr_frame.ll [new file with mode: 0644]
test/CodeGen/Thumb/long-setcc.ll [new file with mode: 0644]
test/CodeGen/Thumb/long.ll [new file with mode: 0644]
test/CodeGen/Thumb/select.ll [new file with mode: 0644]
test/CodeGen/Thumb/stack-frame.ll [new file with mode: 0644]
test/CodeGen/Thumb/thumb-imm.ll [moved from test/CodeGen/ARM/thumb-imm.ll with 100% similarity]
test/CodeGen/Thumb/tst_teq.ll [new file with mode: 0644]
test/CodeGen/Thumb/unord.ll [new file with mode: 0644]
test/CodeGen/Thumb/vargs.ll [moved from test/CodeGen/ARM/vargs2.ll with 90% similarity]
test/CodeGen/Thumb2/thumb2-add.ll [moved from test/CodeGen/ARM/thumb2-add.ll with 100% similarity]
test/CodeGen/Thumb2/thumb2-mov.ll [moved from test/CodeGen/ARM/thumb2-mov.ll with 100% similarity]
test/CodeGen/Thumb2/thumb2-mov2.ll [moved from test/CodeGen/ARM/thumb2-mov2.ll with 100% similarity]
test/CodeGen/Thumb2/thumb2-shifter.ll [moved from test/CodeGen/ARM/thumb2-shifter.ll with 100% similarity]

index 602fd9b..e0cd4e1 100644 (file)
@@ -1,8 +1,4 @@
 ; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=thumb | not grep {ldr sp}
-; RUN: llvm-as < %s | llc -mtriple=thumb-apple-darwin | \
-; RUN:   not grep {sub.*r7}
-; RUN: llvm-as < %s | llc -march=thumb | grep 4294967280
 
        %struct.state = type { i32, %struct.info*, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* }
        %struct.info = type { i32, i32, i32, i32, i32, i32, i32, i8* }
index 2385007..218b25f 100644 (file)
@@ -20,7 +20,6 @@
 ; RUN: grep floatsidf %t
 ; RUN: grep floatunsisf %t
 ; RUN: grep floatunsidf %t
-; RUN: llvm-as < %s | llc -march=thumb
 
 define float @f1(double %x) {
 entry:
index 155763c..461a2c9 100644 (file)
@@ -1,5 +1,4 @@
 ; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=thumb
 
 define double @t(double %x, double %y) nounwind optsize {
 entry:
diff --git a/test/CodeGen/ARM/frame_thumb.ll b/test/CodeGen/ARM/frame_thumb.ll
deleted file mode 100644 (file)
index fe82db9..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=thumb -mtriple=arm-apple-darwin \
-; RUN:     -disable-fp-elim | not grep {r11}
-; RUN: llvm-as < %s | llc -march=thumb -mtriple=arm-linux-gnueabi \
-; RUN:     -disable-fp-elim | not grep {r11}
-
-define i32 @f() {
-entry:
-       ret i32 10
-}
index f10591f..ede6d74 100644 (file)
@@ -1,17 +1,10 @@
 ; RUN: llvm-as < %s | llc -march=arm -stats |& \
 ; RUN:   grep {3 .*Number of machine instrs printed}
-; RUN: llvm-as < %s | llc -march=thumb -stats |& \
-; RUN:   grep {4 .*Number of machine instrs printed}
 
 ;; Integer absolute value, should produce something as good as: ARM:
 ;;   add r3, r0, r0, asr #31
 ;;   eor r0, r3, r0, asr #31
 ;;   bx lr
-;; Thumb:
-;;   asr r2, r0, #31
-;;   add r0, r0, r2
-;;   eor r0, r2
-;;   bx lr
 
 define i32 @test(i32 %a) {
         %tmp1neg = sub i32 0, %a
index 8dcac30..7e8eb42 100644 (file)
@@ -1,5 +1,4 @@
 ; RUN: llvm-as < %s | llc -march=arm | grep {mov r0, r0, lsr #31}
-; RUN: llvm-as < %s | llc -march=thumb | grep {lsr r0, r0, #31}
 
 define i32 @test1(i32 %X) {
 entry:
index 42d7d09..b1738a4 100644 (file)
@@ -1,5 +1,4 @@
 ; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=thumb | grep {ldr.*LCP} | count 5
 
 define void @test1() {
     %tmp = alloca [ 64 x i32 ] , align 4
index edb70d5..b99c721 100644 (file)
@@ -2,10 +2,6 @@
 ; RUN: llvm-as < %s | llc -march=arm | grep ldrh | count 1
 ; RUN: llvm-as < %s | llc -march=arm | grep ldrsb | count 1
 ; RUN: llvm-as < %s | llc -march=arm | grep ldrsh | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep ldrb | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep ldrh | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep ldrsb | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep ldrsh | count 1
 
 define i32 @test1(i8* %v.pntr.s0.u1) {
     %tmp.u = load i8* %v.pntr.s0.u1
index 56acc90..4431506 100644 (file)
@@ -1,5 +1,4 @@
 ; RUN: llvm-as < %s | llc -march=arm | not grep mov
-; RUN: llvm-as < %s | llc -march=thumb | grep cpy | count 2
 
 define i32 @f1() {
        %buf = alloca [32 x i32], align 4
index 12af8b8..4bab330 100644 (file)
@@ -1,5 +1,4 @@
 ; RUN: llvm-as < %s | llc -march=arm | grep cmp | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep cmp | count 1
 
 
 define i1 @t1(i64 %x) {
index c7bb386..fe0ee54 100644 (file)
@@ -9,13 +9,6 @@
 ; RUN:   grep smull | count 1
 ; RUN: llvm-as < %s | llc -march=arm | \
 ; RUN:   grep umull | count 1
-; RUN: llvm-as < %s | llc -march=thumb | \
-; RUN:   grep mvn | count 1
-; RUN: llvm-as < %s | llc -march=thumb | \
-; RUN:   grep adc | count 1
-; RUN: llvm-as < %s | llc -march=thumb | \
-; RUN:   grep sbc | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep __muldi3
 
 define i64 @f1() {
 entry:
index 8d5d2f3..55d0cdc 100644 (file)
@@ -1,4 +1,3 @@
-; RUN: llvm-as < %s | llc -march=thumb
 ; RUN: llvm-as < %s | llc -march=arm > %t
 ; RUN: grep rrx %t | count 1
 ; RUN: grep __ashldi3 %t
index f4f0a04..3543b5d 100644 (file)
@@ -1,7 +1,5 @@
 ; RUN: llvm-as < %s | llc -march=arm | grep mul | count 2
 ; RUN: llvm-as < %s | llc -march=arm | grep lsl | count 2
-; RUN: llvm-as < %s | llc -march=thumb | grep mul | count 3
-; RUN: llvm-as < %s | llc -march=thumb | grep lsl | count 1
 
 define i32 @f1(i32 %u) {
     %tmp = mul i32 %u, %u
index ba29c30..5148a5b 100644 (file)
@@ -6,13 +6,6 @@
 ; RUN: llvm-as < %s | llc -march=arm | grep movhi | count 1
 ; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
 ; RUN:   grep fcpydmi | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep beq | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep bgt | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep blt | count 3
-; RUN: llvm-as < %s | llc -march=thumb | grep ble | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep bls | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep bhi | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep __ltdf2
 
 define i32 @f1(i32 %a.s) {
 entry:
index 73ae11b..c3dd65a 100644 (file)
@@ -1,7 +1,5 @@
 ; RUN: llvm-as < %s | llc -march=arm
 ; RUN: llvm-as < %s | llc -march=arm | grep add | count 1
-; RUN: llvm-as < %s | llc -march=thumb
-; RUN: llvm-as < %s | llc -march=thumb | grep add | count 1
 
 define void @f1() {
        %c = alloca i8, align 1
index e5aa029..bdeee3f 100644 (file)
@@ -1,6 +1,5 @@
 ; RUN: llvm-as < %s | llc -march=arm | grep tst
 ; RUN: llvm-as < %s | llc -march=arm | grep teq
-; RUN: llvm-as < %s | llc -march=thumb | grep tst
 
 define i32 @f(i32 %a) {
 entry:
index e177423..149afc4 100644 (file)
@@ -1,7 +1,5 @@
 ; RUN: llvm-as < %s | llc -march=arm | grep movne | count 1
 ; RUN: llvm-as < %s | llc -march=arm | grep moveq | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep bne | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep beq | count 1
 
 define i32 @f1(float %X, float %Y) {
        %tmp = fcmp uno float %X, %Y
diff --git a/test/CodeGen/Thumb/dyn-stackalloc.ll b/test/CodeGen/Thumb/dyn-stackalloc.ll
new file mode 100644 (file)
index 0000000..cd76250
--- /dev/null
@@ -0,0 +1,59 @@
+; RUN: llvm-as < %s | llc -march=thumb | not grep {ldr sp}
+; RUN: llvm-as < %s | llc -mtriple=thumb-apple-darwin | \
+; RUN:   not grep {sub.*r7}
+; RUN: llvm-as < %s | llc -march=thumb | grep 4294967280
+
+       %struct.state = type { i32, %struct.info*, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* }
+       %struct.info = type { i32, i32, i32, i32, i32, i32, i32, i8* }
+
+define void @t1(%struct.state* %v) {
+       %tmp6 = load i32* null
+       %tmp8 = alloca float, i32 %tmp6
+       store i32 1, i32* null
+       br i1 false, label %bb123.preheader, label %return
+
+bb123.preheader:
+       br i1 false, label %bb43, label %return
+
+bb43:
+       call fastcc void @f1( float* %tmp8, float* null, i32 0 )
+       %tmp70 = load i32* null
+       %tmp85 = getelementptr float* %tmp8, i32 0
+       call fastcc void @f2( float* null, float* null, float* %tmp85, i32 %tmp70 )
+       ret void
+
+return:
+       ret void
+}
+
+declare fastcc void @f1(float*, float*, i32)
+
+declare fastcc void @f2(float*, float*, float*, i32)
+
+       %struct.comment = type { i8**, i32*, i32, i8* }
+@str215 = external global [2 x i8]
+
+define void @t2(%struct.comment* %vc, i8* %tag, i8* %contents) {
+       %tmp1 = call i32 @strlen( i8* %tag )
+       %tmp3 = call i32 @strlen( i8* %contents )
+       %tmp4 = add i32 %tmp1, 2
+       %tmp5 = add i32 %tmp4, %tmp3
+       %tmp6 = alloca i8, i32 %tmp5
+       %tmp9 = call i8* @strcpy( i8* %tmp6, i8* %tag )
+       %tmp6.len = call i32 @strlen( i8* %tmp6 )
+       %tmp6.indexed = getelementptr i8* %tmp6, i32 %tmp6.len
+       call void @llvm.memcpy.i32( i8* %tmp6.indexed, i8* getelementptr ([2 x i8]* @str215, i32 0, i32 0), i32 2, i32 1 )
+       %tmp15 = call i8* @strcat( i8* %tmp6, i8* %contents )
+       call fastcc void @comment_add( %struct.comment* %vc, i8* %tmp6 )
+       ret void
+}
+
+declare i32 @strlen(i8*)
+
+declare i8* @strcat(i8*, i8*)
+
+declare fastcc void @comment_add(%struct.comment*, i8*)
+
+declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
+
+declare i8* @strcpy(i8*, i8*)
diff --git a/test/CodeGen/Thumb/fpconv.ll b/test/CodeGen/Thumb/fpconv.ll
new file mode 100644 (file)
index 0000000..2003131
--- /dev/null
@@ -0,0 +1,61 @@
+; RUN: llvm-as < %s | llc -march=thumb
+
+define float @f1(double %x) {
+entry:
+       %tmp1 = fptrunc double %x to float              ; <float> [#uses=1]
+       ret float %tmp1
+}
+
+define double @f2(float %x) {
+entry:
+       %tmp1 = fpext float %x to double                ; <double> [#uses=1]
+       ret double %tmp1
+}
+
+define i32 @f3(float %x) {
+entry:
+       %tmp = fptosi float %x to i32           ; <i32> [#uses=1]
+       ret i32 %tmp
+}
+
+define i32 @f4(float %x) {
+entry:
+       %tmp = fptoui float %x to i32           ; <i32> [#uses=1]
+       ret i32 %tmp
+}
+
+define i32 @f5(double %x) {
+entry:
+       %tmp = fptosi double %x to i32          ; <i32> [#uses=1]
+       ret i32 %tmp
+}
+
+define i32 @f6(double %x) {
+entry:
+       %tmp = fptoui double %x to i32          ; <i32> [#uses=1]
+       ret i32 %tmp
+}
+
+define float @f7(i32 %a) {
+entry:
+       %tmp = sitofp i32 %a to float           ; <float> [#uses=1]
+       ret float %tmp
+}
+
+define double @f8(i32 %a) {
+entry:
+       %tmp = sitofp i32 %a to double          ; <double> [#uses=1]
+       ret double %tmp
+}
+
+define float @f9(i32 %a) {
+entry:
+       %tmp = uitofp i32 %a to float           ; <float> [#uses=1]
+       ret float %tmp
+}
+
+define double @f10(i32 %a) {
+entry:
+       %tmp = uitofp i32 %a to double          ; <double> [#uses=1]
+       ret double %tmp
+}
diff --git a/test/CodeGen/Thumb/fpow.ll b/test/CodeGen/Thumb/fpow.ll
new file mode 100644 (file)
index 0000000..e5b92ad
--- /dev/null
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc -march=thumb
+
+define double @t(double %x, double %y) nounwind optsize {
+entry:
+       %0 = tail call double @llvm.pow.f64( double %x, double %y )             ; <double> [#uses=1]
+       ret double %0
+}
+
+declare double @llvm.pow.f64(double, double) nounwind readonly
diff --git a/test/CodeGen/Thumb/frame_thumb.ll b/test/CodeGen/Thumb/frame_thumb.ll
new file mode 100644 (file)
index 0000000..270e331
--- /dev/null
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc -mtriple=thumb-apple-darwin \
+; RUN:     -disable-fp-elim | not grep {r11}
+; RUN: llvm-as < %s | llc -mtriple=thumb-linux-gnueabi \
+; RUN:     -disable-fp-elim | not grep {r11}
+
+define i32 @f() {
+entry:
+       ret i32 10
+}
diff --git a/test/CodeGen/Thumb/iabs.ll b/test/CodeGen/Thumb/iabs.ll
new file mode 100644 (file)
index 0000000..13084f6
--- /dev/null
@@ -0,0 +1,17 @@
+; RUN: llvm-as < %s | llc -march=thumb -stats |& \
+; RUN:   grep {4 .*Number of machine instrs printed}
+
+;; Integer absolute value, should produce something as good as:
+;; Thumb:
+;;   asr r2, r0, #31
+;;   add r0, r0, r2
+;;   eor r0, r2
+;;   bx lr
+
+define i32 @test(i32 %a) {
+        %tmp1neg = sub i32 0, %a
+        %b = icmp sgt i32 %a, -1
+        %abs = select i1 %b, i32 %a, i32 %tmp1neg
+        ret i32 %abs
+}
+
diff --git a/test/CodeGen/Thumb/ispositive.ll b/test/CodeGen/Thumb/ispositive.ll
new file mode 100644 (file)
index 0000000..91f5970
--- /dev/null
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc -march=thumb | grep {lsr r0, r0, #31}
+
+define i32 @test1(i32 %X) {
+entry:
+        icmp slt i32 %X, 0              ; <i1>:0 [#uses=1]
+        zext i1 %0 to i32               ; <i32>:1 [#uses=1]
+        ret i32 %1
+}
+
diff --git a/test/CodeGen/Thumb/large-stack.ll b/test/CodeGen/Thumb/large-stack.ll
new file mode 100644 (file)
index 0000000..f7c9ed0
--- /dev/null
@@ -0,0 +1,20 @@
+; RUN: llvm-as < %s | llc -march=thumb | grep {ldr.*LCP} | count 5
+
+define void @test1() {
+    %tmp = alloca [ 64 x i32 ] , align 4
+    ret void
+}
+
+define void @test2() {
+    %tmp = alloca [ 4168 x i8 ] , align 4
+    ret void
+}
+
+define i32 @test3() {
+       %retval = alloca i32, align 4
+       %tmp = alloca i32, align 4
+       %a = alloca [805306369 x i8], align 16
+       store i32 0, i32* %tmp
+       %tmp1 = load i32* %tmp
+        ret i32 %tmp1
+}
diff --git a/test/CodeGen/Thumb/ldr_ext.ll b/test/CodeGen/Thumb/ldr_ext.ll
new file mode 100644 (file)
index 0000000..4b2a7b2
--- /dev/null
@@ -0,0 +1,28 @@
+; RUN: llvm-as < %s | llc -march=thumb | grep ldrb | count 1
+; RUN: llvm-as < %s | llc -march=thumb | grep ldrh | count 1
+; RUN: llvm-as < %s | llc -march=thumb | grep ldrsb | count 1
+; RUN: llvm-as < %s | llc -march=thumb | grep ldrsh | count 1
+
+define i32 @test1(i8* %v.pntr.s0.u1) {
+    %tmp.u = load i8* %v.pntr.s0.u1
+    %tmp1.s = zext i8 %tmp.u to i32
+    ret i32 %tmp1.s
+}
+
+define i32 @test2(i16* %v.pntr.s0.u1) {
+    %tmp.u = load i16* %v.pntr.s0.u1
+    %tmp1.s = zext i16 %tmp.u to i32
+    ret i32 %tmp1.s
+}
+
+define i32 @test3(i8* %v.pntr.s1.u0) {
+    %tmp.s = load i8* %v.pntr.s1.u0
+    %tmp1.s = sext i8 %tmp.s to i32
+    ret i32 %tmp1.s
+}
+
+define i32 @test4() {
+    %tmp.s = load i16* null
+    %tmp1.s = sext i16 %tmp.s to i32
+    ret i32 %tmp1.s
+}
diff --git a/test/CodeGen/Thumb/ldr_frame.ll b/test/CodeGen/Thumb/ldr_frame.ll
new file mode 100644 (file)
index 0000000..0043fb5
--- /dev/null
@@ -0,0 +1,31 @@
+; RUN: llvm-as < %s | llc -march=thumb | grep cpy | count 2
+
+define i32 @f1() {
+       %buf = alloca [32 x i32], align 4
+       %tmp = getelementptr [32 x i32]* %buf, i32 0, i32 0
+       %tmp1 = load i32* %tmp
+       ret i32 %tmp1
+}
+
+define i32 @f2() {
+       %buf = alloca [32 x i8], align 4
+       %tmp = getelementptr [32 x i8]* %buf, i32 0, i32 0
+       %tmp1 = load i8* %tmp
+        %tmp2 = zext i8 %tmp1 to i32
+       ret i32 %tmp2
+}
+
+define i32 @f3() {
+       %buf = alloca [32 x i32], align 4
+       %tmp = getelementptr [32 x i32]* %buf, i32 0, i32 32
+       %tmp1 = load i32* %tmp
+       ret i32 %tmp1
+}
+
+define i32 @f4() {
+       %buf = alloca [32 x i8], align 4
+       %tmp = getelementptr [32 x i8]* %buf, i32 0, i32 2
+       %tmp1 = load i8* %tmp
+        %tmp2 = zext i8 %tmp1 to i32
+       ret i32 %tmp2
+}
diff --git a/test/CodeGen/Thumb/long-setcc.ll b/test/CodeGen/Thumb/long-setcc.ll
new file mode 100644 (file)
index 0000000..df6d137
--- /dev/null
@@ -0,0 +1,17 @@
+; RUN: llvm-as < %s | llc -march=thumb | grep cmp | count 1
+
+
+define i1 @t1(i64 %x) {
+       %B = icmp slt i64 %x, 0
+       ret i1 %B
+}
+
+define i1 @t2(i64 %x) {
+       %tmp = icmp ult i64 %x, 4294967296
+       ret i1 %tmp
+}
+
+define i1 @t3(i32 %x) {
+       %tmp = icmp ugt i32 %x, -1
+       ret i1 %tmp
+}
diff --git a/test/CodeGen/Thumb/long.ll b/test/CodeGen/Thumb/long.ll
new file mode 100644 (file)
index 0000000..2287443
--- /dev/null
@@ -0,0 +1,76 @@
+; RUN: llvm-as < %s | llc -march=thumb | \
+; RUN:   grep mvn | count 1
+; RUN: llvm-as < %s | llc -march=thumb | \
+; RUN:   grep adc | count 1
+; RUN: llvm-as < %s | llc -march=thumb | \
+; RUN:   grep sbc | count 1
+; RUN: llvm-as < %s | llc -march=thumb | grep __muldi3
+
+define i64 @f1() {
+entry:
+        ret i64 0
+}
+
+define i64 @f2() {
+entry:
+        ret i64 1
+}
+
+define i64 @f3() {
+entry:
+        ret i64 2147483647
+}
+
+define i64 @f4() {
+entry:
+        ret i64 2147483648
+}
+
+define i64 @f5() {
+entry:
+        ret i64 9223372036854775807
+}
+
+define i64 @f6(i64 %x, i64 %y) {
+entry:
+        %tmp1 = add i64 %y, 1           ; <i64> [#uses=1]
+        ret i64 %tmp1
+}
+
+define void @f7() {
+entry:
+        %tmp = call i64 @f8( )          ; <i64> [#uses=0]
+        ret void
+}
+
+declare i64 @f8()
+
+define i64 @f9(i64 %a, i64 %b) {
+entry:
+        %tmp = sub i64 %a, %b           ; <i64> [#uses=1]
+        ret i64 %tmp
+}
+
+define i64 @f(i32 %a, i32 %b) {
+entry:
+        %tmp = sext i32 %a to i64               ; <i64> [#uses=1]
+        %tmp1 = sext i32 %b to i64              ; <i64> [#uses=1]
+        %tmp2 = mul i64 %tmp1, %tmp             ; <i64> [#uses=1]
+        ret i64 %tmp2
+}
+
+define i64 @g(i32 %a, i32 %b) {
+entry:
+        %tmp = zext i32 %a to i64               ; <i64> [#uses=1]
+        %tmp1 = zext i32 %b to i64              ; <i64> [#uses=1]
+        %tmp2 = mul i64 %tmp1, %tmp             ; <i64> [#uses=1]
+        ret i64 %tmp2
+}
+
+define i64 @f10() {
+entry:
+        %a = alloca i64, align 8                ; <i64*> [#uses=1]
+        %retval = load i64* %a          ; <i64> [#uses=1]
+        ret i64 %retval
+}
+
diff --git a/test/CodeGen/Thumb/select.ll b/test/CodeGen/Thumb/select.ll
new file mode 100644 (file)
index 0000000..ae75549
--- /dev/null
@@ -0,0 +1,55 @@
+; RUN: llvm-as < %s | llc -march=thumb | grep beq | count 1
+; RUN: llvm-as < %s | llc -march=thumb | grep bgt | count 1
+; RUN: llvm-as < %s | llc -march=thumb | grep blt | count 3
+; RUN: llvm-as < %s | llc -march=thumb | grep ble | count 1
+; RUN: llvm-as < %s | llc -march=thumb | grep bls | count 1
+; RUN: llvm-as < %s | llc -march=thumb | grep bhi | count 1
+; RUN: llvm-as < %s | llc -march=thumb | grep __ltdf2
+
+define i32 @f1(i32 %a.s) {
+entry:
+    %tmp = icmp eq i32 %a.s, 4
+    %tmp1.s = select i1 %tmp, i32 2, i32 3
+    ret i32 %tmp1.s
+}
+
+define i32 @f2(i32 %a.s) {
+entry:
+    %tmp = icmp sgt i32 %a.s, 4
+    %tmp1.s = select i1 %tmp, i32 2, i32 3
+    ret i32 %tmp1.s
+}
+
+define i32 @f3(i32 %a.s, i32 %b.s) {
+entry:
+    %tmp = icmp slt i32 %a.s, %b.s
+    %tmp1.s = select i1 %tmp, i32 2, i32 3
+    ret i32 %tmp1.s
+}
+
+define i32 @f4(i32 %a.s, i32 %b.s) {
+entry:
+    %tmp = icmp sle i32 %a.s, %b.s
+    %tmp1.s = select i1 %tmp, i32 2, i32 3
+    ret i32 %tmp1.s
+}
+
+define i32 @f5(i32 %a.u, i32 %b.u) {
+entry:
+    %tmp = icmp ule i32 %a.u, %b.u
+    %tmp1.s = select i1 %tmp, i32 2, i32 3
+    ret i32 %tmp1.s
+}
+
+define i32 @f6(i32 %a.u, i32 %b.u) {
+entry:
+    %tmp = icmp ugt i32 %a.u, %b.u
+    %tmp1.s = select i1 %tmp, i32 2, i32 3
+    ret i32 %tmp1.s
+}
+
+define double @f7(double %a, double %b) {
+    %tmp = fcmp olt double %a, 1.234e+00
+    %tmp1 = select i1 %tmp, double -1.000e+00, double %b
+    ret double %tmp1
+}
diff --git a/test/CodeGen/Thumb/stack-frame.ll b/test/CodeGen/Thumb/stack-frame.ll
new file mode 100644 (file)
index 0000000..756d257
--- /dev/null
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s | llc -march=thumb
+; RUN: llvm-as < %s | llc -march=thumb | grep add | count 1
+
+define void @f1() {
+       %c = alloca i8, align 1
+       ret void
+}
+
+define i32 @f2() {
+       ret i32 1
+}
+
+
diff --git a/test/CodeGen/Thumb/tst_teq.ll b/test/CodeGen/Thumb/tst_teq.ll
new file mode 100644 (file)
index 0000000..0456951
--- /dev/null
@@ -0,0 +1,17 @@
+; RUN: llvm-as < %s | llc -march=thumb | grep tst
+
+define i32 @f(i32 %a) {
+entry:
+       %tmp2 = and i32 %a, 255         ; <i32> [#uses=1]
+       icmp eq i32 %tmp2, 0            ; <i1>:0 [#uses=1]
+       %retval = select i1 %0, i32 20, i32 10          ; <i32> [#uses=1]
+       ret i32 %retval
+}
+
+define i32 @g(i32 %a) {
+entry:
+        %tmp2 = xor i32 %a, 255
+       icmp eq i32 %tmp2, 0            ; <i1>:0 [#uses=1]
+       %retval = select i1 %0, i32 20, i32 10          ; <i32> [#uses=1]
+       ret i32 %retval
+}
diff --git a/test/CodeGen/Thumb/unord.ll b/test/CodeGen/Thumb/unord.ll
new file mode 100644 (file)
index 0000000..4202d26
--- /dev/null
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -march=thumb | grep bne | count 1
+; RUN: llvm-as < %s | llc -march=thumb | grep beq | count 1
+
+define i32 @f1(float %X, float %Y) {
+       %tmp = fcmp uno float %X, %Y
+       %retval = select i1 %tmp, i32 1, i32 -1
+       ret i32 %retval
+}
+
+define i32 @f2(float %X, float %Y) {
+       %tmp = fcmp ord float %X, %Y
+       %retval = select i1 %tmp, i32 1, i32 -1
+       ret i32 %retval
+}
similarity index 90%
rename from test/CodeGen/ARM/vargs2.ll
rename to test/CodeGen/Thumb/vargs.ll
index 5cc86a9..a18010f 100644 (file)
@@ -1,6 +1,6 @@
 ; RUN: llvm-as < %s | llc -march=thumb
-; RUN: llvm-as < %s | llc -mtriple=arm-linux -march=thumb | grep pop | count 1
-; RUN: llvm-as < %s | llc -mtriple=arm-darwin -march=thumb | grep pop | count 2
+; RUN: llvm-as < %s | llc -mtriple=thumb-linux | grep pop | count 1
+; RUN: llvm-as < %s | llc -mtriple=thumb-darwin | grep pop | count 2
 
 @str = internal constant [4 x i8] c"%d\0A\00"           ; <[4 x i8]*> [#uses=1]