1 ; Basic sanity test to check that instruction operands are encoded with
3 ; RUN: llvm-as < %s | llvm-bcanalyzer -dump | FileCheck %s
4 ; RUN: verify-uselistorder < %s
6 ; CHECK: FUNCTION_BLOCK
7 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
8 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
9 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
10 ; CHECK: INST_RET {{.*}}op0=1
11 define i32 @test_int_binops(i32 %a) nounwind {
20 ; CHECK: FUNCTION_BLOCK
21 ; CHECK: INST_CAST {{.*}}op0=1
22 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
23 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
24 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
25 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
26 ; CHECK: INST_RET {{.*}}op0=1
27 define double @test_float_binops(i32 %a) nounwind {
28 %1 = sitofp i32 %a to double
29 %2 = fadd double %1, %1
30 %3 = fsub double %2, %2
31 %4 = fmul double %3, %3
32 %5 = fdiv double %4, %4
37 ; CHECK: FUNCTION_BLOCK
38 ; skip checking operands of INST_GEP since that depends on ordering
39 ; between literals and the formal parameters.
40 ; CHECK: INST_GEP {{.*}}
41 ; CHECK: INST_LOAD {{.*}}op0=1 {{.*}}
42 ; CHECK: INST_CMP2 op0=1 {{.*}}
43 ; CHECK: INST_RET {{.*}}op0=1
44 define i1 @test_load(i32 %a, {i32, i32}* %ptr) nounwind {
46 %0 = getelementptr inbounds {i32, i32}, {i32, i32}* %ptr, i32 %a, i32 0
47 %1 = load i32, i32* %0
48 %2 = icmp eq i32 %1, %a
52 ; CHECK: Stream type: LLVM IR