summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/constant-islands-cfg.mir
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2017-11-14 11:43:54 +0000
committerTim Northover <tnorthover@apple.com>2017-11-14 11:43:54 +0000
commitcb6b828542759d91ef0c395b66e743c13157526c (patch)
tree45e224d32d797ed910c9d450fa333adb19303287 /test/CodeGen/ARM/constant-islands-cfg.mir
parent155567c8fe982c9ea441262370d425788dbad065 (diff)
ARM: correctly update CFG when splitting BB to fix branch.
Because the block-splitting code is multi-purpose, we have to meddle with the branches when using it to fixup a conditional branch destination. We got the code right, but forgot to update the CFG so the verifier complained when expensive checks were on. Probably harmless since constant-islands comes so late, but best to fix it anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318148 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/constant-islands-cfg.mir')
-rw-r--r--test/CodeGen/ARM/constant-islands-cfg.mir64
1 files changed, 64 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/constant-islands-cfg.mir b/test/CodeGen/ARM/constant-islands-cfg.mir
new file mode 100644
index 00000000000..66d854393b5
--- /dev/null
+++ b/test/CodeGen/ARM/constant-islands-cfg.mir
@@ -0,0 +1,64 @@
+# RUN: llc -mtriple=thumbv6m-apple-ios -run-pass=arm-cp-islands %s -o - | FileCheck %s
+--- |
+ ; Function Attrs: minsize nounwind optsize uwtable
+ define arm_aapcscc double @test_split_cfg(double %a, double %b) local_unnamed_addr #0 {
+ ret double undef
+ }
+...
+---
+name: test_split_cfg
+alignment: 1
+exposesReturnsTwice: false
+legalized: false
+regBankSelected: false
+selected: false
+tracksRegLiveness: true
+registers:
+liveins:
+ - { reg: '%r0', virtual-reg: '' }
+frameInfo:
+ isFrameAddressTaken: false
+ isReturnAddressTaken: false
+ hasStackMap: false
+ hasPatchPoint: false
+ stackSize: 48
+ offsetAdjustment: 0
+ maxAlignment: 4
+ adjustsStack: true
+ hasCalls: true
+ stackProtector: ''
+ maxCallFrameSize: 0
+ hasOpaqueSPAdjustment: false
+ hasVAStart: false
+ hasMustTailInVarArgFunc: false
+ savePoint: ''
+ restorePoint: ''
+fixedStack:
+# CHECK-LABEL: name: test_split_cfg
+# CHECK: bb.0:
+# CHECK: successors: %[[LONG_BR_BB:bb.[0-9]+]](0x{{[0-9a-f]+}}), %[[DEST1:bb.[0-9]+]](0x{{[0-9a-f]+}}){{$}}
+# CHECK: tBcc %[[LONG_BR_BB]], 0, %cpsr
+# CHECK: tB %[[DEST1]]
+# CHECK: [[LONG_BR_BB]]:
+# CHECK: successors: %[[DEST2:bb.[0-9]+]](0x{{[0-9a-f]+}}){{$}}
+# CHECK: tB %[[DEST2]]
+# CHECK: [[DEST1]]:
+# CHECK: [[DEST2]]:
+
+body: |
+ bb.0:
+ liveins: %r0
+ tCMPi8 killed %r0, 0, 14, _, implicit-def %cpsr
+ tBcc %bb.2, 1, killed %cpsr
+ tB %bb.3, 14, _
+
+ bb.1:
+ dead %r0 = SPACE 256, undef %r0
+
+ bb.2:
+ tPOP_RET 14, _, def %pc
+
+ bb.3:
+ tPOP_RET 14, _, def %pc
+
+...