1 ; Test that llvm-reduce can reduce operands
3 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=operands-one --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
4 ; RUN: cat %t | FileCheck %s --check-prefixes=CHECK,ONE
5 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=operands-zero --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
6 ; RUN: cat %t | FileCheck %s --check-prefixes=CHECK,ZERO
7 ; RUN: llvm-reduce --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
8 ; RUN: cat %t | FileCheck %s --check-prefixes=CHECK,ZERO
10 ; CHECK-INTERESTINGNESS: inttoptr
11 ; CHECK-INTERESTINGNESS: inttoptr
12 ; CHECK-INTERESTINGNESS: inttoptr
13 ; CHECK-INTERESTINGNESS: inttoptr
14 ; CHECK-INTERESTINGNESS: br label
15 ; CHECK-INTERESTINGNESS: ret i32
19 declare void @llvm.foo(metadata)
21 ; CHECK-LABEL: define i32 @main
22 define i32 @main(ptr %a, i32 %a2) {
29 ; ZERO: inttoptr i16 0
30 ; ZERO: inttoptr i16 0
31 ; ZERO: inttoptr i16 0
32 ; ZERO: inttoptr i16 0
33 ; CHECK: br label %lb2
35 %b = getelementptr %t, ptr %a, i32 1, i32 0
36 %i1 = inttoptr i16 0 to ptr
37 %i2 = inttoptr i16 1 to ptr
38 %i3 = inttoptr i16 2 to ptr
39 %i4 = inttoptr i16 undef to ptr
40 call void @llvm.foo(metadata ptr %a)