2018-05-17 20:19:58 +02:00
|
|
|
; RUN: opt -debugify-each -O3 -S -o /dev/null < %s 2> %t
|
2018-05-16 19:30:58 +02:00
|
|
|
; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS
|
|
|
|
; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS
|
2020-11-02 17:16:43 +01:00
|
|
|
; RUN: opt -disable-output -debugify-each -passes='default<O3>' %s 2> %t
|
|
|
|
; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS
|
|
|
|
; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS
|
2018-05-16 19:30:58 +02:00
|
|
|
|
2018-05-17 20:19:58 +02:00
|
|
|
; RUN: opt -enable-debugify -debugify-each -O3 -S -o /dev/null < %s 2> %t
|
2018-05-16 19:30:58 +02:00
|
|
|
; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS
|
|
|
|
; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS
|
|
|
|
|
2018-05-17 20:19:58 +02:00
|
|
|
; RUN: opt -debugify-each -instrprof -instrprof -sroa -sccp -S -o /dev/null < %s 2> %t
|
2018-05-16 19:30:58 +02:00
|
|
|
; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS
|
|
|
|
; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS
|
2018-05-15 02:29:27 +02:00
|
|
|
|
2018-05-17 20:19:58 +02:00
|
|
|
; Verify that debugify each can be safely used with piping
|
|
|
|
; RUN: opt -debugify-each -O1 < %s | opt -O2 -o /dev/null
|
|
|
|
|
2018-06-06 21:05:41 +02:00
|
|
|
; Check that the quiet mode emits no messages.
|
|
|
|
; RUN: opt -disable-output -debugify-quiet -debugify-each -O1 < %s 2>&1 | count 0
|
|
|
|
|
2018-06-04 02:11:49 +02:00
|
|
|
; Check that stripped textual IR compares equal before and after applying
|
|
|
|
; debugify.
|
2020-04-10 23:58:13 +02:00
|
|
|
; RUN: opt -O1 < %s -S -o %t.before
|
|
|
|
; RUN: opt -O1 -debugify-each < %s -S -o %t.after
|
2018-06-04 02:11:49 +02:00
|
|
|
; RUN: diff %t.before %t.after
|
|
|
|
|
|
|
|
; Check that stripped IR compares equal before and after applying debugify.
|
2020-04-10 23:58:13 +02:00
|
|
|
; RUN: opt -O1 < %s | llvm-dis -o %t.before
|
|
|
|
; RUN: opt -O1 -debugify-each < %s | llvm-dis -o %t.after
|
2018-06-04 02:11:49 +02:00
|
|
|
; RUN: diff %t.before %t.after
|
|
|
|
|
2020-11-16 20:47:50 +01:00
|
|
|
; Check that we only run debugify once per function per function pass.
|
|
|
|
; This ensures that we don't run it for pass managers/verifiers/printers.
|
|
|
|
; RUN: opt -debugify-each -passes=instsimplify -S -o /dev/null < %s 2> %t
|
|
|
|
; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS-ONE
|
|
|
|
|
|
|
|
; Check that we only run debugify once per module pass
|
|
|
|
; (plus the implicitly added begin/end verifier passes).
|
|
|
|
; RUN: opt -debugify-each -passes=globalopt -S -o /dev/null < %s 2> %t
|
|
|
|
; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS-ONE
|
|
|
|
|
2018-06-04 02:11:49 +02:00
|
|
|
define void @foo(i32 %arg) {
|
|
|
|
call i32 asm "bswap $0", "=r,r"(i32 %arg)
|
2018-05-15 02:29:27 +02:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @bar() {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Verify that the module & function (check-)debugify passes run at least twice.
|
|
|
|
|
2018-05-16 19:30:58 +02:00
|
|
|
; MODULE-PASS: CheckModuleDebugify [{{.*}}]
|
|
|
|
; MODULE-PASS: CheckModuleDebugify [{{.*}}]
|
2018-05-15 02:29:27 +02:00
|
|
|
|
2018-05-16 19:30:58 +02:00
|
|
|
; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}]
|
|
|
|
; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}]
|
|
|
|
; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}]
|
|
|
|
; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}]
|
2020-11-16 20:47:50 +01:00
|
|
|
|
|
|
|
; MODULE-PASS-ONE: CheckModuleDebugify [{{.*}}]
|
|
|
|
; MODULE-PASS-ONE-NOT: CheckModuleDebugify [{{.*}}]
|
|
|
|
|
|
|
|
; FUNCTION-PASS-ONE: CheckFunctionDebugify [{{.*}}]
|
|
|
|
; FUNCTION-PASS-ONE: CheckFunctionDebugify [{{.*}}]
|
|
|
|
; FUNCTION-PASS-ONE-NOT: CheckFunctionDebugify [{{.*}}]
|