• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -fast-isel -mtriple=i686-unknown-unknown -O0 -mcpu=skx | FileCheck %s
3
4@c = external dso_local global i8, align 1
5
6; Function Attrs: noinline nounwind
7define void @_Z1av() {
8; CHECK-LABEL: _Z1av:
9; CHECK:       # %bb.0: # %entry
10; CHECK-NEXT:    subl $2, %esp
11; CHECK-NEXT:    .cfi_def_cfa_offset 6
12; CHECK-NEXT:    xorl %eax, %eax
13; CHECK-NEXT:    # kill: def $al killed $al killed $eax
14; CHECK-NEXT:    movb c, %cl
15; CHECK-NEXT:    xorb $-1, %cl
16; CHECK-NEXT:    testb $1, %cl
17; CHECK-NEXT:    movb %al, (%esp) # 1-byte Spill
18; CHECK-NEXT:    jne .LBB0_1
19; CHECK-NEXT:    jmp .LBB0_2
20; CHECK-NEXT:  .LBB0_1: # %land.rhs
21; CHECK-NEXT:    xorl %eax, %eax
22; CHECK-NEXT:    # kill: def $al killed $al killed $eax
23; CHECK-NEXT:    movb %al, (%esp) # 1-byte Spill
24; CHECK-NEXT:    jmp .LBB0_2
25; CHECK-NEXT:  .LBB0_2: # %land.end
26; CHECK-NEXT:    movb (%esp), %al # 1-byte Reload
27; CHECK-NEXT:    andb $1, %al
28; CHECK-NEXT:    movb %al, {{[0-9]+}}(%esp)
29; CHECK-NEXT:    addl $2, %esp
30; CHECK-NEXT:    .cfi_def_cfa_offset 4
31; CHECK-NEXT:    retl
32entry:
33  %b = alloca i8, align 1
34  %0 = load i8, i8* @c, align 1
35  %tobool = trunc i8 %0 to i1
36  %lnot = xor i1 %tobool, true
37  br i1 %lnot, label %land.rhs, label %land.end
38
39land.rhs:                                         ; preds = %entry
40  br label %land.end
41
42land.end:                                         ; preds = %land.rhs, %entry
43  %1 = phi i1 [ false, %entry ], [ false, %land.rhs ]
44  %conv = zext i1 %1 to i8
45  store i8 %conv, i8* %b, align 1
46  ret void
47}
48