1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
4 %struct.anon = type { i32, i32 }
6 @c = common dso_local global %struct.anon zeroinitializer, align 4
7 @d = dso_local local_unnamed_addr global ptr @c, align 8
8 @a = common dso_local local_unnamed_addr global i32 0, align 4
9 @b = common dso_local local_unnamed_addr global i32 0, align 4
11 ; Function Attrs: norecurse nounwind uwtable
12 define void @g() local_unnamed_addr #0 {
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: movq d(%rip), %rax
16 ; CHECK-NEXT: movl 4(%rax), %eax
17 ; CHECK-NEXT: xorl %ecx, %ecx
18 ; CHECK-NEXT: incl b(%rip)
19 ; CHECK-NEXT: setne %cl
20 ; CHECK-NEXT: addl %eax, %ecx
21 ; CHECK-NEXT: movl %ecx, a(%rip)
24 %0 = load ptr, ptr @d, align 8
25 %y = getelementptr inbounds %struct.anon, ptr %0, i64 0, i32 1
26 %1 = load i32, ptr %y, align 4
27 %2 = load i32, ptr @b, align 4
28 %inc = add nsw i32 %2, 1
29 store i32 %inc, ptr @b, align 4
30 %tobool = icmp ne i32 %inc, 0
31 %land.ext = zext i1 %tobool to i32
32 %add = add nsw i32 %1, %land.ext
33 store i32 %add, ptr @a, align 4