1 # RUN: llc -mtriple=x86_64-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X64
2 # RUN: llc -mtriple=i386-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X32
6 define i32 @test(i32 %a) {
8 %cmp = trunc i32 %a to i1
9 br i1 %cmp, label %true, label %false
11 true: ; preds = %entry
14 false: ; preds = %entry
21 # CHECK-LABEL: name: test
26 - { id: 0, class: gpr, preferred-register: '' }
27 - { id: 1, class: gpr, preferred-register: '' }
28 - { id: 2, class: gpr, preferred-register: '' }
29 - { id: 3, class: gpr, preferred-register: '' }
30 # X64: %0:gr32 = COPY $edi
31 # X32: %0:gr32_abcd = COPY $edi
32 # CHECK-NEXT: %2:gr32 = MOV32r0 implicit-def $eflags
33 # CHECK-NEXT: %3:gr32 = MOV32ri 1
34 # CHECK-NEXT: %1:gr8 = COPY %0.sub_8bit
35 # CHECK-NEXT: TEST8ri %1, 1, implicit-def $eflags
36 # CHECK-NEXT: JCC_1 %[[TRUE:bb.[0-9]+]], 5, implicit $eflags
37 # CHECK-NEXT: JMP_1 %[[FALSE:bb.[0-9]+]]
38 # CHECK: [[TRUE]].{{[a-zA-Z0-9]+}}:
39 # CHECK-NEXT: $eax = COPY %2
40 # CHECK-NEXT: RET 0, implicit $eax
41 # CHECK: [[FALSE]].{{[a-zA-Z0-9]+}}:
42 # CHECK-NEXT: $eax = COPY %3
43 # CHECK-NEXT: RET 0, implicit $eax
48 successors: %bb.2(0x40000000), %bb.3(0x40000000)
52 %2(s32) = G_CONSTANT i32 0
53 %3(s32) = G_CONSTANT i32 1
54 %1(s1) = G_TRUNC %0(s32)
55 G_BRCOND %1(s1), %bb.2