aboutsummaryrefslogtreecommitdiffstats
path: root/test/LTO
diff options
context:
space:
mode:
Diffstat (limited to 'test/LTO')
-rw-r--r--test/LTO/linkonce_odr_func.ll42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/LTO/linkonce_odr_func.ll b/test/LTO/linkonce_odr_func.ll
new file mode 100644
index 0000000..ab96fca
--- /dev/null
+++ b/test/LTO/linkonce_odr_func.ll
@@ -0,0 +1,42 @@
+; RUN: llvm-as < %s >%t1
+; RUN: llvm-lto -o %t2 -dso-symbol=foo1 -dso-symbol=foo2 -dso-symbol=foo3 \
+; RUN: -dso-symbol=foo4 %t1 -disable-opt
+; RUN: llvm-nm %t2 | FileCheck %s
+
+; CHECK: t foo1
+define linkonce_odr void @foo1() noinline {
+ ret void
+}
+
+; CHECK: W foo2
+define linkonce_odr void @foo2() noinline {
+ ret void
+}
+
+; CHECK: t foo3
+define linkonce_odr void @foo3() noinline {
+ ret void
+}
+
+; CHECK: W foo4
+define linkonce_odr void @foo4() noinline {
+ ret void
+}
+
+declare void @f(void()*)
+
+declare void @p()
+
+define void @bar() {
+bb0:
+ call void @foo1()
+ call void @f(void()* @foo2)
+ invoke void @foo3() to label %bb1 unwind label %clean
+bb1:
+ invoke void @f(void()* @foo4) to label %bb2 unwind label %clean
+bb2:
+ ret void
+clean:
+ landingpad {i32, i32} personality void()* @p cleanup
+ ret void
+}