49 lines · plain
1; Test that llvm-reduce can reduce operands2;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 %t4; RUN: cat %t | FileCheck %s --check-prefixes=CHECK,ONE5; 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 %t6; RUN: cat %t | FileCheck %s --check-prefixes=CHECK,ZERO7; RUN: llvm-reduce --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t8; RUN: cat %t | FileCheck %s --check-prefixes=CHECK,ZERO9 10; CHECK-INTERESTINGNESS: inttoptr11; CHECK-INTERESTINGNESS: inttoptr12; CHECK-INTERESTINGNESS: inttoptr13; CHECK-INTERESTINGNESS: inttoptr14; CHECK-INTERESTINGNESS: br label15; CHECK-INTERESTINGNESS: ret i3216 17%t = type { i32, i8 }18 19declare void @llvm.foo(metadata)20 21; CHECK-LABEL: define i32 @main22define i32 @main(ptr %a, i32 %a2) {23 24; CHECK-LABEL: lb1:25; ONE: inttoptr i16 026; ONE: inttoptr i16 127; ONE: inttoptr i16 128; ONE: inttoptr i16 129; ZERO: inttoptr i16 030; ZERO: inttoptr i16 031; ZERO: inttoptr i16 032; ZERO: inttoptr i16 033; CHECK: br label %lb234lb1:35 %b = getelementptr %t, ptr %a, i32 1, i32 036 %i1 = inttoptr i16 0 to ptr37 %i2 = inttoptr i16 1 to ptr38 %i3 = inttoptr i16 2 to ptr39 %i4 = inttoptr i16 undef to ptr40 call void @llvm.foo(metadata ptr %a)41 br label %lb242 43; CHECK-LABEL: lb2:44; ONE: ret i32 145; ZERO: ret i32 046lb2:47 ret i32 %a248}49