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