diff options
author | Dan Gohman <gohman@apple.com> | 2010-02-08 22:02:38 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-02-08 22:02:38 +0000 |
commit | 4268d6a7c37e33b9964d5d7c2fe9bb304ecf5b93 (patch) | |
tree | 98c74837b9eb8a014ff4cc32f2d69431ae41892e /llvm/test/CodeGen/X86/ptrtoint-constexpr.ll | |
parent | 6f9646e1c5a0299cf76e93c804ac401d7e6e7f9f (diff) | |
download | bcm5719-llvm-4268d6a7c37e33b9964d5d7c2fe9bb304ecf5b93.tar.gz bcm5719-llvm-4268d6a7c37e33b9964d5d7c2fe9bb304ecf5b93.zip |
When CodeGen'ing unoptimized code, there may be unfolded constant expressions
in global initializers. Instead of aborting, attempt to fold them on the
spot. If folding succeeds, emit the folded expression instead.
This fixes PR6255.
llvm-svn: 95583
Diffstat (limited to 'llvm/test/CodeGen/X86/ptrtoint-constexpr.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/ptrtoint-constexpr.ll | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/ptrtoint-constexpr.ll b/llvm/test/CodeGen/X86/ptrtoint-constexpr.ll index 7e33e7916c8..dd9790568ab 100644 --- a/llvm/test/CodeGen/X86/ptrtoint-constexpr.ll +++ b/llvm/test/CodeGen/X86/ptrtoint-constexpr.ll @@ -6,3 +6,9 @@ ; CHECK: .quad r&4294967295 @r = global %union.x { i64 ptrtoint (%union.x* @r to i64) }, align 4 + +; CHECK: .globl x +; CHECK: x: +; CHECK: .quad 3 + +@x = global i64 mul (i64 3, i64 ptrtoint (i2* getelementptr (i2* null, i64 1) to i64)) |