llvm.org GIT mirror llvm / cadc38a
Port testcase to FileCheck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166742 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 7 years ago
1 changed file(s) with 40 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
0 ; No arguments means internalize all but main
1 ; RUN: opt < %s -internalize -S | grep internal | count 4
1 ; RUN: opt < %s -internalize -S | FileCheck --check-prefix=NOARGS %s
2
23 ; Internalize all but foo and j
3 ; RUN: opt < %s -internalize -internalize-public-api-list foo -internalize-public-api-list j -S | grep internal | count 3
4 ; RUN: opt < %s -internalize -internalize-public-api-list foo -internalize-public-api-list j -S | FileCheck --check-prefix=LIST %s
5
46 ; Non existent files should be treated as if they were empty (so internalize all but main)
5 ; RUN: opt < %s -internalize -internalize-public-api-file /nonexistent/file 2> /dev/null -S | grep internal | count 4
6 ; RUN: opt < %s -internalize -internalize-public-api-list bar -internalize-public-api-list foo -internalize-public-api-file /nonexistent/file 2> /dev/null -S | grep internal | count 3
7 ; RUN: opt < %s -internalize -internalize-public-api-file /nonexistent/file 2> /dev/null -S | FileCheck --check-prefix=EMPTYFILE %s
8
9 ; RUN: opt < %s -S -internalize -internalize-public-api-list bar -internalize-public-api-list foo -internalize-public-api-file /nonexistent/file 2> /dev/null | FileCheck --check-prefix=LIST2 %s
10
711 ; -file and -list options should be merged, the .apifile contains foo and j
8 ; RUN: opt < %s -internalize -internalize-public-api-list bar -internalize-public-api-file %s.apifile -S | grep internal | count 2
12 ; RUN: opt < %s -internalize -internalize-public-api-list bar -internalize-public-api-file %s.apifile -S | FileCheck --check-prefix=MERGE %s
913
10 @i = weak global i32 0 ; [#uses=0]
11 @j = weak global i32 0 ; [#uses=0]
14 ; NOARGS: @i = internal global
15 ; LIST: @i = internal global
16 ; EMPTYFILE: @i = internal global
17 ; LIST2: @i = internal global
18 ; MERGE: @i = internal global
19 @i = global i32 0
1220
13 define void @main(...) {
14 entry:
21 ; NOARGS: @j = internal global
22 ; LIST: @j = global
23 ; EMPTYFILE: @j = internal global
24 ; LIST2: @j = internal global
25 ; MERGE: @j = global
26 @j = global i32 0
27
28 ; NOARGS: define void @main
29 ; LIST: define internal void @main
30 ; EMPTYFILE: define void @main
31 ; LIST2: define internal void @main
32 ; MERGE: define internal void @main
33 define void @main() {
1534 ret void
1635 }
1736
18 define void @foo(...) {
19 entry:
37 ; NOARGS: define internal void @foo
38 ; LIST: define void @foo
39 ; EMPTYFILE: define internal void @foo
40 ; LIST2: define void @foo
41 ; MERGE: define void @foo
42 define void @foo() {
2043 ret void
2144 }
2245
23 define void @bar(...) {
24 entry:
46 ; NOARGS: define internal void @bar
47 ; LIST: define internal void @bar
48 ; EMPTYFILE: define internal void @bar
49 ; LIST2: define void @bar
50 ; MERGE: define void @bar
51 define void @bar() {
2552 ret void
2653 }