blob: e290b948cc76d5720169caf9c793175cae7569ac [file] [log] [blame]
Anastasis Grammenosac5db0d2018-05-17 18:19:58 +00001; RUN: opt -debugify-each -O3 -S -o /dev/null < %s 2> %t
Vedant Kumar1222d612018-05-16 17:30:58 +00002; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS
3; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS
4
Anastasis Grammenosac5db0d2018-05-17 18:19:58 +00005; RUN: opt -enable-debugify -debugify-each -O3 -S -o /dev/null < %s 2> %t
Vedant Kumar1222d612018-05-16 17:30:58 +00006; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS
7; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS
8
Anastasis Grammenosac5db0d2018-05-17 18:19:58 +00009; RUN: opt -debugify-each -instrprof -instrprof -sroa -sccp -S -o /dev/null < %s 2> %t
Vedant Kumar1222d612018-05-16 17:30:58 +000010; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS
11; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS
Vedant Kumarb12dd1f2018-05-15 00:29:27 +000012
Anastasis Grammenosac5db0d2018-05-17 18:19:58 +000013; Verify that debugify each can be safely used with piping
14; RUN: opt -debugify-each -O1 < %s | opt -O2 -o /dev/null
15
Vedant Kumarf0c081c2018-06-06 19:05:41 +000016; 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 Kumarf66cfed2018-06-04 00:11:49 +000019; Check that stripped textual IR compares equal before and after applying
20; debugify.
21; RUN: opt -O1 < %s -S -o - | \
Vedant Kumar9e729a32018-06-05 00:56:08 +000022; RUN: opt -strip -strip-dead-prototypes -strip-named-metadata -S -o %t.before
Vedant Kumarf66cfed2018-06-04 00:11:49 +000023; RUN: opt -O1 -debugify-each < %s -S -o - | \
Vedant Kumar9e729a32018-06-05 00:56:08 +000024; RUN: opt -strip -strip-dead-prototypes -strip-named-metadata -S -o %t.after
Vedant Kumarf66cfed2018-06-04 00:11:49 +000025; 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 Kumar9e729a32018-06-05 00:56:08 +000029; RUN: opt -strip -strip-dead-prototypes -strip-named-metadata | \
Vedant Kumarf66cfed2018-06-04 00:11:49 +000030; RUN: llvm-dis -o %t.before
31; RUN: opt -O1 -debugify-each < %s | \
Vedant Kumar9e729a32018-06-05 00:56:08 +000032; RUN: opt -strip -strip-dead-prototypes -strip-named-metadata | \
Vedant Kumarf66cfed2018-06-04 00:11:49 +000033; RUN: llvm-dis -o %t.after
34; RUN: diff %t.before %t.after
35
36define void @foo(i32 %arg) {
37 call i32 asm "bswap $0", "=r,r"(i32 %arg)
Vedant Kumarb12dd1f2018-05-15 00:29:27 +000038 ret void
39}
40
41define void @bar() {
42 ret void
43}
44
45; Verify that the module & function (check-)debugify passes run at least twice.
46
Vedant Kumar1222d612018-05-16 17:30:58 +000047; MODULE-PASS: CheckModuleDebugify [{{.*}}]
48; MODULE-PASS: CheckModuleDebugify [{{.*}}]
Vedant Kumarb12dd1f2018-05-15 00:29:27 +000049
Vedant Kumar1222d612018-05-16 17:30:58 +000050; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}]
51; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}]
52; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}]
53; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}]