Anastasis Grammenos | ac5db0d | 2018-05-17 18:19:58 +0000 | [diff] [blame] | 1 | ; RUN: opt -debugify-each -O3 -S -o /dev/null < %s 2> %t |
Vedant Kumar | 1222d61 | 2018-05-16 17:30:58 +0000 | [diff] [blame] | 2 | ; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS |
| 3 | ; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS |
| 4 | |
Anastasis Grammenos | ac5db0d | 2018-05-17 18:19:58 +0000 | [diff] [blame] | 5 | ; RUN: opt -enable-debugify -debugify-each -O3 -S -o /dev/null < %s 2> %t |
Vedant Kumar | 1222d61 | 2018-05-16 17:30:58 +0000 | [diff] [blame] | 6 | ; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS |
| 7 | ; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS |
| 8 | |
Anastasis Grammenos | ac5db0d | 2018-05-17 18:19:58 +0000 | [diff] [blame] | 9 | ; RUN: opt -debugify-each -instrprof -instrprof -sroa -sccp -S -o /dev/null < %s 2> %t |
Vedant Kumar | 1222d61 | 2018-05-16 17:30:58 +0000 | [diff] [blame] | 10 | ; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS |
| 11 | ; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS |
Vedant Kumar | b12dd1f | 2018-05-15 00:29:27 +0000 | [diff] [blame] | 12 | |
Anastasis Grammenos | ac5db0d | 2018-05-17 18:19:58 +0000 | [diff] [blame] | 13 | ; Verify that debugify each can be safely used with piping |
| 14 | ; RUN: opt -debugify-each -O1 < %s | opt -O2 -o /dev/null |
| 15 | |
Vedant Kumar | f0c081c | 2018-06-06 19:05:41 +0000 | [diff] [blame] | 16 | ; Check that the quiet mode emits no messages. |
| 17 | ; RUN: opt -disable-output -debugify-quiet -debugify-each -O1 < %s 2>&1 | count 0 |
| 18 | |
Vedant Kumar | f66cfed | 2018-06-04 00:11:49 +0000 | [diff] [blame] | 19 | ; Check that stripped textual IR compares equal before and after applying |
| 20 | ; debugify. |
| 21 | ; RUN: opt -O1 < %s -S -o - | \ |
Vedant Kumar | 9e729a3 | 2018-06-05 00:56:08 +0000 | [diff] [blame] | 22 | ; RUN: opt -strip -strip-dead-prototypes -strip-named-metadata -S -o %t.before |
Vedant Kumar | f66cfed | 2018-06-04 00:11:49 +0000 | [diff] [blame] | 23 | ; RUN: opt -O1 -debugify-each < %s -S -o - | \ |
Vedant Kumar | 9e729a3 | 2018-06-05 00:56:08 +0000 | [diff] [blame] | 24 | ; RUN: opt -strip -strip-dead-prototypes -strip-named-metadata -S -o %t.after |
Vedant Kumar | f66cfed | 2018-06-04 00:11:49 +0000 | [diff] [blame] | 25 | ; RUN: diff %t.before %t.after |
| 26 | |
| 27 | ; Check that stripped IR compares equal before and after applying debugify. |
| 28 | ; RUN: opt -O1 < %s | \ |
Vedant Kumar | 9e729a3 | 2018-06-05 00:56:08 +0000 | [diff] [blame] | 29 | ; RUN: opt -strip -strip-dead-prototypes -strip-named-metadata | \ |
Vedant Kumar | f66cfed | 2018-06-04 00:11:49 +0000 | [diff] [blame] | 30 | ; RUN: llvm-dis -o %t.before |
| 31 | ; RUN: opt -O1 -debugify-each < %s | \ |
Vedant Kumar | 9e729a3 | 2018-06-05 00:56:08 +0000 | [diff] [blame] | 32 | ; RUN: opt -strip -strip-dead-prototypes -strip-named-metadata | \ |
Vedant Kumar | f66cfed | 2018-06-04 00:11:49 +0000 | [diff] [blame] | 33 | ; RUN: llvm-dis -o %t.after |
| 34 | ; RUN: diff %t.before %t.after |
| 35 | |
| 36 | define void @foo(i32 %arg) { |
| 37 | call i32 asm "bswap $0", "=r,r"(i32 %arg) |
Vedant Kumar | b12dd1f | 2018-05-15 00:29:27 +0000 | [diff] [blame] | 38 | ret void |
| 39 | } |
| 40 | |
| 41 | define void @bar() { |
| 42 | ret void |
| 43 | } |
| 44 | |
| 45 | ; Verify that the module & function (check-)debugify passes run at least twice. |
| 46 | |
Vedant Kumar | 1222d61 | 2018-05-16 17:30:58 +0000 | [diff] [blame] | 47 | ; MODULE-PASS: CheckModuleDebugify [{{.*}}] |
| 48 | ; MODULE-PASS: CheckModuleDebugify [{{.*}}] |
Vedant Kumar | b12dd1f | 2018-05-15 00:29:27 +0000 | [diff] [blame] | 49 | |
Vedant Kumar | 1222d61 | 2018-05-16 17:30:58 +0000 | [diff] [blame] | 50 | ; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}] |
| 51 | ; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}] |
| 52 | ; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}] |
| 53 | ; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}] |