Propagate relocation info to resolveRelocation.
[oota-llvm.git] / test / ExecutionEngine / MCJIT / test-common-symbols-alignment.ll
1 ; RUN: %lli_mcjit -O0 %s
2 ; XFAIL: darwin
3
4 ; This test checks that common symbols have been allocated addresses honouring
5 ; the alignment requirement.
6
7 @CS1 = common global i32 0, align 16
8 @CS2 = common global i8 0, align 1
9 @CS3 = common global i32 0, align 16
10
11 define i32 @main() nounwind {
12 entry:
13     %retval = alloca i32, align 4
14     %ptr = alloca i32, align 4
15     store i32 0, i32* %retval
16     store i32 ptrtoint (i32* @CS3 to i32), i32* %ptr, align 4
17     %0 = load i32* %ptr, align 4
18     %and = and i32 %0, 15
19     %tobool = icmp ne i32 %and, 0
20     br i1 %tobool, label %if.then, label %if.else
21
22 if.then:                                          ; preds = %entry
23     store i32 1, i32* %retval
24     br label %return
25
26 if.else:                                          ; preds = %entry
27     store i32 0, i32* %retval
28     br label %return
29
30 return:                                           ; preds = %if.else, %if.then
31     %1 = load i32* %retval
32     ret i32 %1
33 }