1 ; RUN: llc < %s -fast-isel -mtriple=i386-apple-darwin | FileCheck %s
3 @src = external global i32
6 define i32 @loadgv() nounwind {
8 %0 = load i32* @src, align 4
9 %1 = load i32* @src, align 4
11 store i32 %2, i32* @src
13 ; This should fold one of the loads into the add.
15 ; CHECK: movl L_src$non_lazy_ptr, %ecx
16 ; CHECK: movl (%ecx), %eax
17 ; CHECK: addl (%ecx), %eax
18 ; CHECK: movl %eax, (%ecx)
23 %stuff = type { i32 (...)** }
24 @LotsStuff = external constant [4 x i32 (...)*]
26 define void @t(%stuff* %this) nounwind {
28 store i32 (...)** getelementptr ([4 x i32 (...)*]* @LotsStuff, i32 0, i32 2), i32 (...)*** null, align 4
31 ; CHECK: movl $0, %eax
32 ; CHECK: movl L_LotsStuff$non_lazy_ptr, %ecx