28 lines · plain
1; Check that lli respects alignment on global variables.2;3; Returns ((uint32_t)&B & 0x7) - A + C. Variables A and C have byte-alignment,4; and are intended to increase the chance of misalignment, but don't contribute5; to the result, since they have the same initial value.6;7; A failure may indicate a problem with alignment handling in the JIT linker or8; JIT memory manager.9;10; RUN: %lli %s11 12@A = internal global i8 1, align 113@B = global i64 1, align 814@C = internal global i8 1, align 115 16define i32 @main(i32 %argc, i8** %argv) {17entry:18 %0 = ptrtoint i8* @B to i3219 %1 = and i32 %0, 720 %2 = load i8, i8* @A21 %3 = zext i8 %2 to i3222 %4 = add i32 %1, %323 %5 = load i8, i8* @C24 %6 = zext i8 %5 to i3225 %7 = sub i32 %4, %626 ret i32 %727}28