xref: /llvm-project/llvm/test/tools/llvm-reduce/bitcode-uselistorder.ll (revision cea72fe34194d58ac1ba9485ee9c9a63cf98a4e6)
1; Sometimes fails with an assert on many targets.
2; UNSUPPORTED: target={{.*}}
3
4; RUN: llvm-as -o %t.bc %s
5
6; RUN: llvm-reduce -j=1 --abort-on-invalid-reduction \
7; RUN:   --delta-passes=instructions -o %t.reduced.bc \
8; RUN:   --test %python --test-arg %p/Inputs/llvm-dis-and-filecheck.py \
9; RUN:   --test-arg llvm-dis \
10; RUN:   --test-arg FileCheck --test-arg --check-prefix=INTERESTING \
11; RUN:   --test-arg %s %t.bc
12
13; RUN: llvm-dis --preserve-ll-uselistorder -o %t.reduced.ll %t.reduced.bc
14
15; RUN: FileCheck -check-prefix=RESULT %s < %t.reduced.ll
16
17
18; INTERESTING: add
19; INTERESTING: add
20; INTERESTING: add
21define i32 @func(i32 %arg0, i32 %arg1) {
22entry:
23  %add0 = add i32 %arg0, 0
24  %add1 = add i32 %add0, 0
25  %add2 = add i32 %add1, 0
26  %add3 = add i32 %arg1, 0
27  %add4 = add i32 %add2, %add3
28  ret i32 %add4
29}
30
31; INTERESTING: uselistorder
32; RESULT: uselistorder
33uselistorder i32 0, { 3, 2, 1, 0 }
34