aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/ARM')
-rw-r--r--test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll4
-rw-r--r--test/CodeGen/ARM/armv4.ll17
-rw-r--r--test/CodeGen/ARM/debug-segmented-stacks.ll4
-rw-r--r--test/CodeGen/ARM/no-fpscr-liveness.ll49
-rw-r--r--test/CodeGen/ARM/pr32578.ll27
-rw-r--r--test/CodeGen/ARM/segmented-stacks-dynamic.ll8
-rw-r--r--test/CodeGen/ARM/segmented-stacks.ll4
7 files changed, 102 insertions, 11 deletions
diff --git a/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll b/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll
index f50916e4b474..82e9b20731e4 100644
--- a/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll
+++ b/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll
@@ -1,5 +1,5 @@
-; RUN: llc -mtriple arm-unknown -mattr=+vfp2 -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=LITTLE
-; RUN: llc -mtriple armeb-unknown -mattr=+vfp2 -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=BIG
+; RUN: llc -mtriple arm-unknown -mattr=+vfp2,+v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=LITTLE
+; RUN: llc -mtriple armeb-unknown -mattr=+vfp2,+v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=BIG
define void @test_void_return() {
; CHECK-LABEL: name: test_void_return
diff --git a/test/CodeGen/ARM/armv4.ll b/test/CodeGen/ARM/armv4.ll
index 6b213d564bd6..a0379caaa4fb 100644
--- a/test/CodeGen/ARM/armv4.ll
+++ b/test/CodeGen/ARM/armv4.ll
@@ -5,9 +5,24 @@
; RUN: llc < %s -mtriple=armv4-unknown-eabi | FileCheck %s -check-prefix=ARM
; RUN: llc < %s -mtriple=armv4t-unknown-eabi | FileCheck %s -check-prefix=THUMB
-define i32 @test(i32 %a) nounwind readnone {
+define i32 @test_return(i32 %a) nounwind readnone {
entry:
+; ARM-LABEL: test_return
; ARM: mov pc
+; THUMB-LABEL: test_return
; THUMB: bx
ret i32 %a
}
+
+@helper = global i32 ()* null, align 4
+
+define i32 @test_indirect() #0 {
+entry:
+; ARM-LABEL: test_indirect
+; ARM: mov pc
+; THUMB-LABEL: test_indirect
+; THUMB: bx
+ %0 = load i32 ()*, i32 ()** @helper, align 4
+ %call = tail call i32 %0()
+ ret i32 %call
+}
diff --git a/test/CodeGen/ARM/debug-segmented-stacks.ll b/test/CodeGen/ARM/debug-segmented-stacks.ll
index 3aa33f754118..6dafcecf0f00 100644
--- a/test/CodeGen/ARM/debug-segmented-stacks.ll
+++ b/test/CodeGen/ARM/debug-segmented-stacks.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -verify-machineinstrs -filetype=asm | FileCheck %s -check-prefix=ARM-linux
-; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -filetype=obj
+; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -verify-machineinstrs -filetype=asm | FileCheck %s -check-prefix=ARM-linux
+; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -filetype=obj
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!9, !10}
diff --git a/test/CodeGen/ARM/no-fpscr-liveness.ll b/test/CodeGen/ARM/no-fpscr-liveness.ll
new file mode 100644
index 000000000000..6575ab6c55d5
--- /dev/null
+++ b/test/CodeGen/ARM/no-fpscr-liveness.ll
@@ -0,0 +1,49 @@
+; RUN: llc -o - %s | FileCheck %s
+; Make sure we do not try to compute liveness for FPSCR which in this case
+; is read before being written to (this is fine because becase FPSCR is
+; reserved).
+target triple = "thumbv7s-apple-ios"
+
+%struct.wibble = type { double }
+
+@global = common global i32 0, align 4
+@global.1 = common global i32 0, align 4
+
+; CHECK-LABEL: eggs:
+; CHECK: sub sp, #8
+; VMRS instruction comes before any other instruction writing FPSCR:
+; CHECK-NEXT: vmrs r0, fpscr
+; ...
+; CHECK: add sp, #8
+; CHECK: bx lr
+define i32 @eggs(double* nocapture readnone %arg) {
+bb:
+ %tmp = alloca %struct.wibble, align 4
+ %tmp1 = bitcast %struct.wibble* %tmp to i8*
+ %tmp2 = tail call i32 @llvm.flt.rounds()
+ %tmp3 = ptrtoint %struct.wibble* %tmp to i32
+ %tmp4 = sitofp i32 %tmp3 to double
+ %tmp5 = fmul double %tmp4, 0x0123456789ABCDEF
+ %tmp6 = fptosi double %tmp5 to i32
+ %tmp7 = fcmp une double %tmp5, 0.000000e+00
+ %tmp8 = sitofp i32 %tmp6 to double
+ %tmp9 = fcmp une double %tmp5, %tmp8
+ %tmp10 = and i1 %tmp7, %tmp9
+ %tmp11 = sext i1 %tmp10 to i32
+ %tmp12 = add nsw i32 %tmp11, %tmp6
+ store i32 %tmp12, i32* @global, align 4
+ %tmp13 = icmp ne i32 %tmp12, 0
+ %tmp14 = icmp ne i32 %tmp2, 0
+ %tmp15 = and i1 %tmp14, %tmp13
+ br i1 %tmp15, label %bb16, label %bb18
+
+bb16: ; preds = %bb
+ %tmp17 = load i32, i32* @global.1, align 4
+ br label %bb18
+
+bb18: ; preds = %bb16, %bb
+ ret i32 undef
+}
+
+declare i32 @llvm.flt.rounds()
+declare i32 @zot(...)
diff --git a/test/CodeGen/ARM/pr32578.ll b/test/CodeGen/ARM/pr32578.ll
new file mode 100644
index 000000000000..541ba35e5be5
--- /dev/null
+++ b/test/CodeGen/ARM/pr32578.ll
@@ -0,0 +1,27 @@
+; RUN: llc -o - %s | FileCheck %s
+target triple = "armv7"
+
+; CHECK-LABEL: func:
+; CHECK: push {r11, lr}
+; CHECK: vpush {d8}
+; CEHCK: b .LBB0_2
+define arm_aapcscc double @func() {
+ br label %tailrecurse
+
+tailrecurse:
+ %v0 = load i16, i16* undef, align 8
+ %cond36.i = icmp eq i16 %v0, 3
+ br i1 %cond36.i, label %sw.bb.i, label %sw.epilog.i
+
+sw.bb.i:
+ %v1 = load double, double* undef, align 8
+ %call21.i = tail call arm_aapcscc double @func()
+ %mul.i = fmul double %v1, %call21.i
+ ret double %mul.i
+
+sw.epilog.i:
+ tail call arm_aapcscc void @_ZNK10shared_ptrdeEv()
+ br label %tailrecurse
+}
+
+declare arm_aapcscc void @_ZNK10shared_ptrdeEv() local_unnamed_addr
diff --git a/test/CodeGen/ARM/segmented-stacks-dynamic.ll b/test/CodeGen/ARM/segmented-stacks-dynamic.ll
index 86f8ff8dd90b..65d25cad386e 100644
--- a/test/CodeGen/ARM/segmented-stacks-dynamic.ll
+++ b/test/CodeGen/ARM/segmented-stacks-dynamic.ll
@@ -1,7 +1,7 @@
-; RUN: llc < %s -mtriple=arm-linux-androideabi -verify-machineinstrs | FileCheck %s -check-prefix=ARM-android
-; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -verify-machineinstrs | FileCheck %s -check-prefix=ARM-linux
-; RUN: llc < %s -mtriple=arm-linux-androideabi -filetype=obj
-; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -filetype=obj
+; RUN: llc < %s -mtriple=arm-linux-androideabi -mattr=+v4t -verify-machineinstrs | FileCheck %s -check-prefix=ARM-android
+; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -verify-machineinstrs | FileCheck %s -check-prefix=ARM-linux
+; RUN: llc < %s -mtriple=arm-linux-androideabi -mattr=+v4t -filetype=obj
+; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -filetype=obj
; Just to prevent the alloca from being optimized away
declare void @dummy_use(i32*, i32)
diff --git a/test/CodeGen/ARM/segmented-stacks.ll b/test/CodeGen/ARM/segmented-stacks.ll
index cbb124de11c3..4fe84faa17fd 100644
--- a/test/CodeGen/ARM/segmented-stacks.ll
+++ b/test/CodeGen/ARM/segmented-stacks.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -mtriple=arm-linux-androideabi -verify-machineinstrs | FileCheck %s -check-prefix=ARM-android
-; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -verify-machineinstrs | FileCheck %s -check-prefix=ARM-linux
+; RUN: llc < %s -mtriple=arm-linux-androideabi -mattr=+v4t -verify-machineinstrs | FileCheck %s -check-prefix=ARM-android
+; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -verify-machineinstrs | FileCheck %s -check-prefix=ARM-linux
; We used to crash with filetype=obj
; RUN: llc < %s -mtriple=arm-linux-androideabi -filetype=obj