summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/debugtrap.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/ARM/debugtrap.ll')
-rw-r--r--test/CodeGen/ARM/debugtrap.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/debugtrap.ll b/test/CodeGen/ARM/debugtrap.ll
new file mode 100644
index 000000000000..9ce73939ce56
--- /dev/null
+++ b/test/CodeGen/ARM/debugtrap.ll
@@ -0,0 +1,17 @@
+; This test ensures the @llvm.debugtrap() call is not removed when generating
+; the 'pop' instruction to restore the callee saved registers on ARM.
+
+; RUN: llc < %s -mtriple=armv7 -O0 -filetype=asm | FileCheck %s
+
+declare void @llvm.debugtrap() nounwind
+declare void @foo() nounwind
+
+define void @test() nounwind {
+entry:
+ ; CHECK: bl foo
+ ; CHECK-NEXT: pop
+ ; CHECK-NEXT: trap
+ call void @foo()
+ call void @llvm.debugtrap()
+ ret void
+}