Taewook Oh | 1975e63 | 2019-09-04 08:08:58 +0000 | [diff] [blame] | 1 | ; Check pass name is only printed once. |
Hongtao Yu | bae33a7 | 2020-02-23 15:13:27 -0800 | [diff] [blame] | 2 | ; Check only one function is printed |
| 3 | ; RUN: opt < %s 2>&1 -forceattrs -disable-output -print-after-all -filter-print-funcs=foo | FileCheck %s -check-prefix=FOO |
| 4 | ; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=foo | FileCheck %s -check-prefix=FOO |
| 5 | |
| 6 | ; Check pass name is only printed once. |
| 7 | ; Check both functions are printed |
| 8 | ; RUN: opt < %s 2>&1 -forceattrs -disable-output -print-after-all -filter-print-funcs=foo,bar | FileCheck %s -check-prefix=BOTH |
| 9 | ; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=foo,bar | FileCheck %s -check-prefix=BOTH |
Taewook Oh | 1975e63 | 2019-09-04 08:08:58 +0000 | [diff] [blame] | 10 | |
| 11 | ; Check pass name is not printed if a module doesn't include any function specified in -filter-print-funcs. |
| 12 | ; RUN: opt < %s 2>&1 -forceattrs -disable-output -print-after-all -filter-print-funcs=baz | FileCheck %s -allow-empty -check-prefix=EMPTY |
Hongtao Yu | bae33a7 | 2020-02-23 15:13:27 -0800 | [diff] [blame] | 13 | ; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=baz | FileCheck %s -allow-empty -check-prefix=EMPTY |
Taewook Oh | 1975e63 | 2019-09-04 08:08:58 +0000 | [diff] [blame] | 14 | |
Hongtao Yu | bae33a7 | 2020-02-23 15:13:27 -0800 | [diff] [blame] | 15 | ; Check whole module is printed with user-specified wildcast switch -filter-print-funcs=* or -print-module-scope |
| 16 | ; RUN: opt < %s 2>&1 -forceattrs -disable-output -print-after-all | FileCheck %s -check-prefix=ALL |
| 17 | ; RUN: opt < %s 2>&1 -forceattrs -disable-output -print-after-all -filter-print-funcs=* | FileCheck %s -check-prefix=ALL |
| 18 | ; RUN: opt < %s 2>&1 -forceattrs -disable-output -print-after-all -filter-print-funcs=foo -print-module-scope | FileCheck %s -check-prefix=ALL |
| 19 | ; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all | FileCheck %s -check-prefix=ALL |
| 20 | ; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=* | FileCheck %s -check-prefix=ALL |
| 21 | ; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=foo -print-module-scope | FileCheck %s -check-prefix=ALL |
| 22 | |
| 23 | ; FOO: IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}} |
| 24 | ; FOO: define void @foo |
| 25 | ; FOO-NOT: define void @bar |
| 26 | ; FOO-NOT: IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}} |
| 27 | |
| 28 | ; BOTH: IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}} |
| 29 | ; BOTH: define void @foo |
| 30 | ; BOTH: define void @bar |
| 31 | ; BOTH-NOT: IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}} |
| 32 | ; BOTH-NOT: ModuleID = |
| 33 | |
| 34 | ; EMPTY-NOT: IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}} |
| 35 | |
| 36 | ; ALL: IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}} |
| 37 | ; ALL: ModuleID = |
| 38 | ; ALL: define void @foo |
| 39 | ; ALL: define void @bar |
| 40 | ; ALL-NOT: IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}} |
Taewook Oh | 1975e63 | 2019-09-04 08:08:58 +0000 | [diff] [blame] | 41 | |
| 42 | define void @foo() { |
| 43 | ret void |
| 44 | } |
| 45 | |
| 46 | define void @bar() { |
| 47 | ret void |
| 48 | } |