2013-10-31 20:51:58 +00:00
|
|
|
; RUN: llvm-as < %s >%t1
|
|
|
|
; RUN: llvm-lto -o %t2 -dso-symbol=foo1 -dso-symbol=foo2 -dso-symbol=foo3 \
|
2014-02-07 19:04:43 +00:00
|
|
|
; RUN: -dso-symbol=foo4 -dso-symbol=v1 -dso-symbol=v2 %t1 -disable-opt
|
2013-10-31 20:51:58 +00:00
|
|
|
; RUN: llvm-nm %t2 | FileCheck %s
|
2013-10-25 21:29:52 +00:00
|
|
|
|
2013-11-02 06:00:09 +00:00
|
|
|
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
2013-10-31 21:27:02 +00:00
|
|
|
|
2013-11-01 01:14:20 +00:00
|
|
|
; CHECK: t foo1
|
2013-11-02 06:00:09 +00:00
|
|
|
define linkonce_odr void @foo1() noinline {
|
2013-10-25 21:29:52 +00:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-11-02 06:00:09 +00:00
|
|
|
; CHECK: W foo2
|
|
|
|
define linkonce_odr void @foo2() noinline {
|
2013-10-25 21:29:52 +00:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-10-31 20:51:58 +00:00
|
|
|
; CHECK: t foo3
|
2013-11-02 06:00:09 +00:00
|
|
|
define linkonce_odr void @foo3() noinline {
|
2013-10-25 21:29:52 +00:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-11-02 06:00:09 +00:00
|
|
|
; CHECK: W foo4
|
|
|
|
define linkonce_odr void @foo4() noinline {
|
2013-10-25 21:29:52 +00:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-02-07 19:04:43 +00:00
|
|
|
; CHECK: r v1
|
|
|
|
@v1 = linkonce_odr constant i32 32
|
|
|
|
|
2014-12-08 18:45:16 +00:00
|
|
|
define i32 @useV1() {
|
|
|
|
%x = load i32* @v1
|
|
|
|
ret i32 %x
|
|
|
|
}
|
|
|
|
|
2014-02-07 19:04:43 +00:00
|
|
|
; CHECK: V v2
|
|
|
|
@v2 = linkonce_odr global i32 32
|
|
|
|
|
2014-12-08 18:45:16 +00:00
|
|
|
define i32 @useV2() {
|
|
|
|
%x = load i32* @v2
|
|
|
|
ret i32 %x
|
|
|
|
}
|
|
|
|
|
2013-10-25 21:29:52 +00:00
|
|
|
declare void @f(void()*)
|
|
|
|
|
2013-10-31 20:51:58 +00:00
|
|
|
declare void @p()
|
|
|
|
|
2013-10-25 21:29:52 +00:00
|
|
|
define void @bar() {
|
|
|
|
bb0:
|
2013-11-02 06:00:09 +00:00
|
|
|
call void @foo1()
|
|
|
|
call void @f(void()* @foo2)
|
|
|
|
invoke void @foo3() to label %bb1 unwind label %clean
|
2013-10-25 21:29:52 +00:00
|
|
|
bb1:
|
2013-11-02 06:00:09 +00:00
|
|
|
invoke void @f(void()* @foo4) to label %bb2 unwind label %clean
|
2013-10-25 21:29:52 +00:00
|
|
|
bb2:
|
|
|
|
ret void
|
|
|
|
clean:
|
2013-10-31 20:51:58 +00:00
|
|
|
landingpad {i32, i32} personality void()* @p cleanup
|
2013-10-25 21:29:52 +00:00
|
|
|
ret void
|
|
|
|
}
|