1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ;RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=slow-incdec | FileCheck %s
4 @var_21 = external dso_local constant i32, align 4
5 @var_29 = external dso_local constant i8, align 1
6 @var_390 = external dso_local global i32, align 4
7 @var_11 = external dso_local constant i8, align 1
8 @var_370 = external dso_local global i8, align 1
10 ; Function Attrs: noinline nounwind optnone uwtable
11 define void @_Z3foov() {
12 ; CHECK-LABEL: _Z3foov:
13 ; CHECK: # %bb.0: # %entry
14 ; CHECK-NEXT: movsbl var_29(%rip), %eax
15 ; CHECK-NEXT: negl %eax
16 ; CHECK-NEXT: xorl %ecx, %ecx
17 ; CHECK-NEXT: cmpl %eax, var_21(%rip)
18 ; CHECK-NEXT: setb %cl
19 ; CHECK-NEXT: movl %ecx, var_390(%rip)
20 ; CHECK-NEXT: movzbl var_11(%rip), %eax
21 ; CHECK-NEXT: movb %al, var_370(%rip)
24 %0 = load i32, ptr @var_21, align 4
25 %1 = load i8, ptr @var_29, align 1
26 %conv = sext i8 %1 to i32
27 %sub = sub nsw i32 0, %conv
28 %cmp = icmp ult i32 %0, %sub
29 %conv1 = zext i1 %cmp to i32
30 %add = add nsw i32 %conv1, -1
31 %conv2 = trunc i32 %add to i8
32 %tobool = icmp ne i8 %conv2, 0
33 %lnot = xor i1 %tobool, true
34 %conv3 = zext i1 %lnot to i32
35 store i32 %conv3, ptr @var_390, align 4
36 %2 = load i8, ptr @var_11, align 1
37 %conv4 = sext i8 %2 to i16
38 %conv5 = trunc i16 %conv4 to i8
39 store i8 %conv5, ptr @var_370, align 1