blob: dfee4f2a11ea1da35d9c755657d66ecdf4792053 [file] [log] [blame]
Evan Cheng483f0db2008-09-09 01:26:59 +00001; RUN: llvm-as < %s | llc -fast-isel -mtriple=i386-apple-darwin | \
Dan Gohman0dd5fd92008-09-19 22:16:54 +00002; RUN: grep lazy_ptr, | count 2
Evan Cheng483f0db2008-09-09 01:26:59 +00003; 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}