1 ; This test is checking basic properties of -print-module-scope options:
2 ; - dumps all the module IR at once
3 ; - all the function attributes are shown, including those of declarations
4 ; - works on top of -print-after and -filter-print-funcs
6 ; RUN: opt < %s 2>&1 -disable-output \
7 ; RUN: -simplifycfg -print-after=simplifycfg -print-module-scope \
8 ; RUN: | FileCheck %s -check-prefix=CFG
9 ; RUN: opt < %s 2>&1 -disable-output \
10 ; RUN: -passes=simplify-cfg -print-after-all -print-module-scope \
11 ; RUN: | FileCheck %s -check-prefix=CFG
12 ; RUN: opt < %s 2>&1 -disable-output \
13 ; RUN: -simplifycfg -print-after=simplifycfg -filter-print-funcs=foo -print-module-scope \
14 ; RUN: | FileCheck %s -check-prefix=FOO
15 ; RUN: opt < %s 2>&1 -disable-output \
16 ; RUN: -passes=simplify-cfg -print-after-all -filter-print-funcs=foo -print-module-scope \
17 ; RUN: | FileCheck %s -check-prefix=FOO
19 ; CFG: IR Dump After {{Simplify the CFG|SimplifyCFGPass}}
20 ; CFG-SAME: function: foo
21 ; CFG-NEXT: ModuleID =
22 ; CFG: define void @foo
23 ; CFG: define void @bar
24 ; CFG: declare void @baz
26 ; CFG-SAME: function: bar
27 ; CFG-NEXT: ModuleID =
28 ; CFG: define void @foo
29 ; CFG: define void @bar
30 ; CFG: declare void @baz
32 ; FOO: IR Dump After {{Simplify the CFG|SimplifyCFGPass}}
33 ; FOO-NOT: function: bar
34 ; FOO-SAME: function: foo
35 ; FOO-NEXT: ModuleID =
36 ; FOO: Function Attrs: nounwind ssp
37 ; FOO: define void @foo
38 ; FOO: Function Attrs: nounwind
39 ; FOO: define void @bar
40 ; FOO: Function Attrs: nounwind readnone ssp
41 ; FOO: declare void @baz
43 define void @foo() nounwind ssp {
48 define void @bar() #0 {
52 declare void @baz() #1
54 attributes #0 = { nounwind "no-frame-pointer-elim"="true" }
56 attributes #1 = { nounwind readnone ssp "use-soft-float"="false" }
57 ; FOO: attributes #{{[0-9]}} = { nounwind "no-frame-pointer-elim"="true" }
59 ; FOO: attributes #{{[0-9]}} = { nounwind readnone ssp "use-soft-float"="false" }
61 ; FOO-NOT: IR Dump After {{Simplify the CFG|SimplifyCFGPass}}