blob: 5ee56761576c96b15149a05671ef218ec8f3e5d6 [file] [log] [blame]
Evan Cheng483f0db2008-09-09 01:26:59 +00001; RUN: llvm-as < %s | llc -fast-isel -mtriple=i386-apple-darwin | \
2; RUN: grep mov | grep lazy_ptr | count 2
3; RUN: llvm-as < %s | llc -fast-isel -march=x86 -relocation-model=static | \
4; RUN: grep lea
Evan Chengca0fb992008-09-04 06:18:33 +00005
6@src = external global i32
7
8define i32 @loadgv() nounwind {
9entry:
10 %0 = load i32* @src, align 4
11 %1 = load i32* @src, align 4
12 %2 = add i32 %0, %1
Evan Cheng483f0db2008-09-09 01:26:59 +000013 store i32 %2, i32* @src
Evan Chengca0fb992008-09-04 06:18:33 +000014 ret i32 %2
15}
Evan Cheng483f0db2008-09-09 01:26:59 +000016
17%stuff = type { i32 (...)** }
18@LotsStuff = external constant [4 x i32 (...)*]
19
20define void @t(%stuff* %this) nounwind {
21entry:
22 store i32 (...)** getelementptr ([4 x i32 (...)*]* @LotsStuff, i32 0, i32 2), i32 (...)*** null, align 4
23 ret void
24}