blob: 57573ed76f9a9064df905e7bd2535f6d192c9623 [file] [log] [blame]
Dan Gohmanbe2d4e72010-09-23 00:33:13 +00001; RUN: llvm-extract -func foo -S < %s | FileCheck %s
2; RUN: llvm-extract -delete -func foo -S < %s | FileCheck --check-prefix=DELETE %s
3; RUN: llvm-as < %s > %t
4; RUN: llvm-extract -func foo -S %t | FileCheck %s
5; RUN: llvm-extract -delete -func foo -S %t | FileCheck --check-prefix=DELETE %s
6
7; llvm-extract uses lazy bitcode loading, so make sure it correctly reads
8; from bitcode files in addition to assembly files.
9
10; CHECK: define void @foo() {
11; CHECK: ret void
12; CHECK: }
Bob Wilsonedf01742010-09-23 17:25:06 +000013
14; The linkonce_odr linkage for foo() should be changed to external linkage.
15; DELETE: declare void @foo()
Dan Gohmanbe2d4e72010-09-23 00:33:13 +000016; DELETE: define void @bar() {
Bob Wilsonedf01742010-09-23 17:25:06 +000017; DELETE: call void @foo()
Dan Gohmanbe2d4e72010-09-23 00:33:13 +000018; DELETE: ret void
19; DELETE: }
20
Bob Wilsonedf01742010-09-23 17:25:06 +000021define linkonce_odr void @foo() {
Dan Gohmanbe2d4e72010-09-23 00:33:13 +000022 ret void
23}
24define void @bar() {
Bob Wilsonedf01742010-09-23 17:25:06 +000025 call void @foo()
Dan Gohmanbe2d4e72010-09-23 00:33:13 +000026 ret void
27}