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