blob: 631cb2f67af0950369e83f9d3043b89fde39dd20 [file] [log] [blame]
Eric Christopher79cc1e32014-09-02 22:28:02 +00001; RUN: %lli %s
Ulrich Weigand78e97652013-04-05 13:29:04 +00002;
3; Verify relocations to global symbols with addend work correctly.
4;
5; Compiled from this C code:
6;
7; int test[2] = { -1, 0 };
8; int *p = &test[1];
9;
10; int main (void)
11; {
12; return *p;
13; }
14;
15
16@test = global [2 x i32] [i32 -1, i32 0], align 4
David Blaikief72d05b2015-03-13 18:20:45 +000017@p = global i32* getelementptr inbounds ([2 x i32], [2 x i32]* @test, i64 0, i64 1), align 8
Ulrich Weigand78e97652013-04-05 13:29:04 +000018
19define i32 @main() {
20entry:
David Blaikiea79ac142015-02-27 21:17:42 +000021 %0 = load i32*, i32** @p, align 8
22 %1 = load i32, i32* %0, align 4
Ulrich Weigand78e97652013-04-05 13:29:04 +000023 ret i32 %1
24}
25