1 ; Basic correctness 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_UNOP {{.*}}op0=1
8 ; CHECK: INST_RET {{.*}}op0=1
9 define double @test_float_unops(double %a) nounwind {
15 ; CHECK: FUNCTION_BLOCK
16 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
17 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
18 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
19 ; CHECK: INST_RET {{.*}}op0=1
20 define i32 @test_int_binops(i32 %a) nounwind {
29 ; CHECK: FUNCTION_BLOCK
30 ; CHECK: INST_CAST {{.*}}op0=1
31 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
32 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
33 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
34 ; CHECK: INST_BINOP {{.*}}op0=1 op1=1
35 ; CHECK: INST_RET {{.*}}op0=1
36 define double @test_float_binops(i32 %a) nounwind {
37 %1 = sitofp i32 %a to double
38 %2 = fadd double %1, %1
39 %3 = fsub double %2, %2
40 %4 = fmul double %3, %3
41 %5 = fdiv double %4, %4
46 ; CHECK: FUNCTION_BLOCK
47 ; skip checking operands of INST_GEP since that depends on ordering
48 ; between literals and the formal parameters.
49 ; CHECK: INST_GEP {{.*}}
50 ; CHECK: INST_LOAD {{.*}}op0=1 {{.*}}
51 ; CHECK: INST_CMP2 op0=1 {{.*}}
52 ; CHECK: INST_RET {{.*}}op0=1
53 define i1 @test_load(i32 %a, {i32, i32}* %ptr) nounwind {
55 %0 = getelementptr inbounds {i32, i32}, {i32, i32}* %ptr, i32 %a, i32 0
56 %1 = load i32, i32* %0
57 %2 = icmp eq i32 %1, %a
61 ; CHECK: Stream type: LLVM IR