blob: 35ec1e7115b24bb2ad062bc0b4ea6b43878dc1bd [file] [log] [blame]
Dan Gohman0a063102009-09-08 23:54:48 +00001; RUN: llc < %s -fast-isel -mtriple=i386-apple-darwin | \
Dan Gohman0dd5fd92008-09-19 22:16:54 +00002; RUN: grep lazy_ptr, | count 2
Dan Gohman0a063102009-09-08 23:54:48 +00003; RUN: llc < %s -fast-isel -march=x86 -relocation-model=static | \
Evan Cheng483f0db2008-09-09 01:26:59 +00004; 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}