Skip to content

Commit 724f209

Browse files
authored
llvm-reduce: Add -abort-on-invalid-reduction to more tests (#133390)
If I flip the default, the only failures are in MIR tests.
1 parent 8726e97 commit 724f209

12 files changed

+18
-18
lines changed

llvm/test/tools/llvm-reduce/distinct-dimetadata-nullptr.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; Test checking that distinct metadata reduction pass handles null pointers properly.
22
; This test will lead to a crash if nullptrs inside distinct metadata are not handled correctly, in this case inside DICompileUnit
33

4-
; RUN: llvm-reduce --delta-passes=distinct-metadata --aggressive-named-md-reduction --test FileCheck --test-arg %s --test-arg --input-file %s -o %t
4+
; RUN: llvm-reduce -abort-on-invalid-reduction --delta-passes=distinct-metadata --aggressive-named-md-reduction --test FileCheck --test-arg %s --test-arg --input-file %s -o %t
55
; CHECK: {{.*}}distinct !DICompileUnit{{.*}}
66

77

llvm/test/tools/llvm-reduce/operands-to-args-metadata.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llvm-reduce %s -o %t --delta-passes=operands-to-args --test FileCheck --test-arg %s --test-arg --input-file
1+
; RUN: llvm-reduce -abort-on-invalid-reduction %s -o %t --delta-passes=operands-to-args --test FileCheck --test-arg %s --test-arg --input-file
22

33
; CHECK: @foo
44

llvm/test/tools/llvm-reduce/reduce-distinct-metadata.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; Test that every boring node is removed and all interesting distinct nodes remain after aggressive distinct metadata reduction.
22

3-
; RUN: llvm-reduce --aggressive-named-md-reduction --test %python --test-arg %p/Inputs/reduce-distinct-metadata.py %s -o %t
3+
; RUN: llvm-reduce -abort-on-invalid-reduction --aggressive-named-md-reduction --test %python --test-arg %p/Inputs/reduce-distinct-metadata.py %s -o %t
44
; RUN: FileCheck %s < %t
55

66
; CHECK-NOT: {{.*}}boring{{.*}}

llvm/test/tools/llvm-reduce/remove-attributes-from-intrinsics.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; We can't actually put attributes on intrinsic declarations, only on call sites.
22
;
3-
; RUN: llvm-reduce --test FileCheck --test-arg --check-prefixes=CHECK-ALL,CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
4-
; RUN: cat %t | FileCheck --check-prefixes=CHECK-ALL,CHECK-FINAL %s
3+
; RUN: llvm-reduce -abort-on-invalid-reduction --test FileCheck --test-arg --check-prefixes=CHECK-ALL,CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
4+
; RUN: FileCheck --check-prefixes=CHECK-ALL,CHECK-FINAL %s < %t
55

66
define i32 @t(i32 %a) {
77
; CHECK-ALL-LABEL: @t(

llvm/test/tools/llvm-reduce/remove-function-bodies.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llvm-reduce --test FileCheck --test-arg --check-prefixes=CHECK-ALL,CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
2-
; RUN: cat %t | FileCheck --check-prefixes=CHECK-ALL,CHECK-FINAL %s
1+
; RUN: llvm-reduce --abort-on-invalid-reduction --test FileCheck --test-arg --check-prefixes=CHECK-ALL,CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
2+
; RUN: FileCheck --check-prefixes=CHECK-ALL,CHECK-FINAL %s < %t
33

44
; CHECK-INTERESTINGNESS: @callee(
55
; CHECK-FINAL: declare void @callee()

llvm/test/tools/llvm-reduce/remove-instructions.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; Test that llvm-reduce can remove uninteresting instructions.
22
;
3-
; RUN: llvm-reduce --test %python --test-arg %p/Inputs/remove-instructions.py %s -o %t
3+
; RUN: llvm-reduce -abort-on-invalid-reduction --test %python --test-arg %p/Inputs/remove-instructions.py %s -o %t
44
; RUN: cat %t | FileCheck -implicit-check-not=uninteresting %s
55
; REQUIRES: plugins
66

llvm/test/tools/llvm-reduce/remove-metadata.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
; Test that llvm-reduce can remove uninteresting metadata from an IR file.
22
; The Metadata pass erases named & unnamed metadata nodes.
33
;
4-
; RUN: llvm-reduce --aggressive-named-md-reduction --test %python --test-arg %p/Inputs/remove-metadata.py %s -o %t
5-
; RUN: FileCheck --check-prefixes=AGGRESSIVE --implicit-check-not=! %s < %t
4+
; RUN: llvm-reduce -abort-on-invalid-reduction --aggressive-named-md-reduction --test %python --test-arg %p/Inputs/remove-metadata.py %s -o %t
5+
; RUN: FileCheck --check-prefixes=AGGRESSIVE --implicit-check-not=! %s < %t
66

7-
; RUN: llvm-reduce --test %python --test-arg %p/Inputs/remove-metadata.py %s -o %t
7+
; RUN: llvm-reduce -abort-on-invalid-reduction --test %python --test-arg %p/Inputs/remove-metadata.py %s -o %t
88
; RUN: FileCheck --implicit-check-not=! %s < %t
99

1010
@global = global i32 0, !dbg !0

llvm/test/tools/llvm-reduce/remove-module-data.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; REQUIRES: x86-registered-target
22

33
; RUN: opt %s -S | FileCheck --check-prefix=CHECK-FILE %s
4-
; RUN: llvm-reduce --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
4+
; RUN: llvm-reduce -abort-on-invalid-reduction --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
55
; RUN: FileCheck --check-prefix=CHECK-FINAL %s < %t
66

77
; CHECK-INTERESTINGNESS: declare

llvm/test/tools/llvm-reduce/remove-multiple-use-of-args-in-same-instruction.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; Test that llvm-reduce can remove uninteresting function arguments from function definitions as well as their calls.
22
;
3-
; RUN: llvm-reduce --test FileCheck --test-arg --check-prefix=CHECK-ALL --test-arg %s --test-arg --input-file %s -o %t
3+
; RUN: llvm-reduce -abort-on-invalid-reduction --test FileCheck --test-arg --check-prefix=CHECK-ALL --test-arg %s --test-arg --input-file %s -o %t
44
; RUN: FileCheck --check-prefix=CHECK-ALL %s < %t
55

66
; CHECK-ALL: declare void @use(i32, i32, i32)

llvm/test/tools/llvm-reduce/skip-delta-passes.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
; RUN: llvm-reduce --delta-passes=attributes --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
1+
; RUN: llvm-reduce -abort-on-invalid-reduction --delta-passes=attributes --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
22
; RUN: FileCheck -check-prefix=RESULT %s < %t
33

4-
; RUN: llvm-reduce --delta-passes=instructions,attributes --skip-delta-passes=instructions --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
4+
; RUN: llvm-reduce -abort-on-invalid-reduction --delta-passes=instructions,attributes --skip-delta-passes=instructions --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
55
; RUN: FileCheck -check-prefix=RESULT %s < %t
66

7-
; RUN: not llvm-reduce --skip-delta-passes=foo --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2>&1 | FileCheck %s --check-prefix=ERROR
7+
; RUN: not llvm-reduce -abort-on-invalid-reduction --skip-delta-passes=foo --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2>&1 | FileCheck %s --check-prefix=ERROR
88

99

1010
; CHECK-INTERESTINGNESS: @foo

0 commit comments

Comments
 (0)