[RuntimeDyld] Make sure we emit MachO __eh_frame and __gcc_except_tab sections,
[oota-llvm.git] / test / Other / extract-linkonce.ll
1 ; RUN: llvm-extract -func foo -S < %s | FileCheck %s
2 ; RUN: llvm-extract -delete -func foo -S < %s | FileCheck --check-prefix=DELETE %s
3
4 ; Test that linkonce definitions are mapped to weak so that they are not
5 ; dropped.
6
7 ; CHECK:      @bar = external global i32
8 ; CHECK:      define weak i32* @foo() {
9 ; CHECK-NEXT:  ret i32* @bar
10 ; CHECK-NEXT: }
11
12 ; DELETE: @bar = weak global i32 42
13 ; DELETE: declare i32* @foo()
14
15 @bar = linkonce global i32 42
16
17 define linkonce i32* @foo() {
18   ret i32* @bar
19 }
20
21 define void @g() {
22   call i32* @foo()
23   ret void
24 }