llvm-project
54 строки · 1.8 Кб
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
5;
6; RUN: opt < %s 2>&1 -disable-output \
7; RUN: -passes=simplifycfg -print-after-all -print-module-scope \
8; RUN: | FileCheck %s -check-prefix=CFG
9; RUN: opt < %s 2>&1 -disable-output \
10; RUN: -passes=simplifycfg -print-after=simplifycfg -print-module-scope \
11; RUN: | FileCheck %s -check-prefix=CFG
12; RUN: opt < %s 2>&1 -disable-output \
13; RUN: -passes=simplifycfg -print-after=simplifycfg -filter-print-funcs=foo -print-module-scope \
14; RUN: | FileCheck %s -check-prefix=FOO
15
16; CFG: IR Dump After {{Simplify the CFG|SimplifyCFGPass}} {{.*}}foo
17; CFG-NEXT: ModuleID =
18; CFG: define void @foo
19; CFG: define void @bar
20; CFG: declare void @baz
21; CFG: IR Dump After {{.*}}bar
22; CFG-NEXT: ModuleID =
23; CFG: define void @foo
24; CFG: define void @bar
25; CFG: declare void @baz
26
27; FOO: IR Dump After {{Simplify the CFG|SimplifyCFGPass}} {{.*foo}}
28; FOO-NEXT: ModuleID =
29; FOO: Function Attrs: nounwind ssp
30; FOO: define void @foo
31; FOO: Function Attrs: nounwind
32; FOO: define void @bar
33; FOO: Function Attrs: nounwind ssp memory(none)
34; FOO: declare void @baz
35
36define void @foo() nounwind ssp {
37call void @baz()
38ret void
39}
40
41define void @bar() #0 {
42ret void
43}
44
45declare void @baz() #1
46
47attributes #0 = { nounwind "frame-pointer"="all" }
48
49attributes #1 = { nounwind readnone ssp "use-soft-float"="false" }
50; FOO: attributes #{{[0-9]}} = { nounwind "frame-pointer"="all" }
51
52; FOO: attributes #{{[0-9]}} = { nounwind ssp memory(none) "use-soft-float"="false" }
53
54; FOO-NOT: IR Dump After {{Simplify the CFG|SimplifyCFGPass}}
55