1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2 ; RUN: llc < %s | FileCheck %s 3 4 target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" 5 target triple = "i386-unknown-linux-gnu" 6 7 @b = global i16 0, align 4 8 9 define i32 @main() { 10 ; CHECK-LABEL: main: 11 ; CHECK: # %bb.0: # %entry 12 ; CHECK-NEXT: xorl %eax, %eax 13 ; CHECK-NEXT: testb %al, %al 14 ; CHECK-NEXT: jne .LBB0_3 15 ; CHECK-NEXT: # %bb.1: # %go 16 ; CHECK-NEXT: movl $-1, %ecx 17 ; CHECK-NEXT: movsbl b, %edx 18 ; CHECK-NEXT: notl %ecx 19 ; CHECK-NEXT: movzwl %dx, %edx 20 ; CHECK-NEXT: cmpl $-1, %edx 21 ; CHECK-NEXT: sbbl %ecx, %eax 22 ; CHECK-NEXT: jge .LBB0_3 23 ; CHECK-NEXT: # %bb.2: # %if.then 24 ; CHECK-NEXT: movl $42, %eax 25 ; CHECK-NEXT: retl 26 ; CHECK-NEXT: .LBB0_3: # %if.else 27 ; CHECK-NEXT: xorl %eax, %eax 28 ; CHECK-NEXT: retl 29 entry: 30 %true = icmp eq i32 0, 0 31 %const = bitcast i64 -4294967296 to i64 32 br i1 %true, label %go, label %if.else 33 34 go: 35 %b = load i16, i16* @b, align 4 36 %sext = shl i16 %b, 8 37 %conv = ashr i16 %sext, 8 38 %neg4 = xor i64 %const, -1 39 %conv5 = zext i16 %conv to i64 40 %cmp = icmp slt i64 %conv5, %neg4 41 br i1 %cmp, label %if.then, label %if.else 42 43 if.then: 44 ret i32 42 45 46 if.else: 47 ret i32 0 48 } 49 50