summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-10-17 17:38:49 +0000
committerBill Wendling <isanbard@gmail.com>2013-10-17 17:38:49 +0000
commit20a7ec92475e6209892dd2201b4bbf852d6fa122 (patch)
tree5229db2f5ee24c84506a5627f6d92a045735b1a5 /test
parent52244da7f2b3def646900520668b859343b84a33 (diff)
downloadllvm-20a7ec92475e6209892dd2201b4bbf852d6fa122.tar.gz
llvm-20a7ec92475e6209892dd2201b4bbf852d6fa122.tar.bz2
llvm-20a7ec92475e6209892dd2201b4bbf852d6fa122.tar.xz
Add testcase to make sure we don't generate a compact unwind section for ELF binaries.
This tests r190354. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/no-elf-compact-unwind.ll48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/CodeGen/X86/no-elf-compact-unwind.ll b/test/CodeGen/X86/no-elf-compact-unwind.ll
new file mode 100644
index 0000000000..8a15817bcf
--- /dev/null
+++ b/test/CodeGen/X86/no-elf-compact-unwind.ll
@@ -0,0 +1,48 @@
+; RUN: llc < %s -mtriple x86_64-apple-macosx10.8.0 -disable-cfi | FileCheck -check-prefix=MACHO %s
+; RUN: llc < %s -mtriple x86_64-unknown-linux -disable-cfi | FileCheck -check-prefix=ELF %s
+
+; Make sure we don't generate a compact unwind for ELF.
+
+; MACHO-LABEL: _Z3barv:
+; MACHO: __compact_unwind
+
+; ELF-LABEL: _Z3barv:
+; ELF-NOT: __compact_unwind
+
+@_ZTIi = external constant i8*
+
+define void @_Z3barv() uwtable {
+entry:
+ invoke void @_Z3foov()
+ to label %try.cont unwind label %lpad
+
+lpad: ; preds = %entry
+ %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ catch i8* bitcast (i8** @_ZTIi to i8*)
+ %1 = extractvalue { i8*, i32 } %0, 1
+ %2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
+ %matches = icmp eq i32 %1, %2
+ br i1 %matches, label %catch, label %eh.resume
+
+catch: ; preds = %lpad
+ %3 = extractvalue { i8*, i32 } %0, 0
+ %4 = tail call i8* @__cxa_begin_catch(i8* %3)
+ tail call void @__cxa_end_catch()
+ br label %try.cont
+
+try.cont: ; preds = %entry, %catch
+ ret void
+
+eh.resume: ; preds = %lpad
+ resume { i8*, i32 } %0
+}
+
+declare void @_Z3foov()
+
+declare i32 @__gxx_personality_v0(...)
+
+declare i32 @llvm.eh.typeid.for(i8*)
+
+declare i8* @__cxa_begin_catch(i8*)
+
+declare void @__cxa_end_catch()