diff options
author | Tim Northover <Tim.Northover@arm.com> | 2012-10-29 10:47:07 +0000 |
---|---|---|
committer | Tim Northover <Tim.Northover@arm.com> | 2012-10-29 10:47:07 +0000 |
commit | b210e6fea56ecc8126d5101ccd2539da23546641 (patch) | |
tree | 5739d2f77bb5199324d541c202117e10470cab29 /test/ExecutionEngine | |
parent | f00677d74f1be5b4c7c73e1681a64c9062f4c7ee (diff) |
Align the data section correctly when loading an ELF file.
Patch by Amara Emerson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ExecutionEngine')
-rw-r--r-- | test/ExecutionEngine/MCJIT/test-data-align.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ExecutionEngine/MCJIT/test-data-align.ll b/test/ExecutionEngine/MCJIT/test-data-align.ll new file mode 100644 index 0000000000..0493cba87f --- /dev/null +++ b/test/ExecutionEngine/MCJIT/test-data-align.ll @@ -0,0 +1,15 @@ +; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -O0 %s + +; Check that a variable is always aligned as specified. + +@var = global i32 0, align 32 +define i32 @main() { + %addr = ptrtoint i32* @var to i64 + %mask = and i64 %addr, 31 + %tst = icmp eq i64 %mask, 0 + br i1 %tst, label %good, label %bad +good: + ret i32 0 +bad: + ret i32 1 +} |