diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-06-26 03:02:19 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-06-26 03:02:19 +0000 |
commit | 29640bcb7d7738e7e611b0150b6ac57e2d2b723f (patch) | |
tree | 81c70c56439220a7417280abe3657ed676384430 /test/Transforms | |
parent | b0f5a0e7e7fb08f6ab97603ef68b4837f62755a0 (diff) | |
download | llvm-29640bcb7d7738e7e611b0150b6ac57e2d2b723f.tar.gz llvm-29640bcb7d7738e7e611b0150b6ac57e2d2b723f.tar.bz2 llvm-29640bcb7d7738e7e611b0150b6ac57e2d2b723f.tar.xz |
GlobalOpt: Don't optimize thread_local for initializers
Folding a reference to a thread_local variable into another global
variable's initializer is very problematic, there is no relocation that
exists to represent such an access.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211762 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/GlobalOpt/constantfold-initializers.ll | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/Transforms/GlobalOpt/constantfold-initializers.ll b/test/Transforms/GlobalOpt/constantfold-initializers.ll index 53e8465b5e..8fc13304f1 100644 --- a/test/Transforms/GlobalOpt/constantfold-initializers.ll +++ b/test/Transforms/GlobalOpt/constantfold-initializers.ll @@ -72,9 +72,19 @@ entry: ret void } +@threadlocalptr = global i32* null, align 4 +; CHECK: @threadlocalptr = global i32* null, align 4 +@threadlocalvar = external thread_local global i32 +define internal void @test5() { +entry: + store i32* @threadlocalvar, i32** @threadlocalptr, align 4 + ret void +} + @llvm.global_ctors = appending constant - [4 x { i32, void ()* }] + [5 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @test1 }, { i32, void ()* } { i32 65535, void ()* @test2 }, { i32, void ()* } { i32 65535, void ()* @test3 }, + { i32, void ()* } { i32 65535, void ()* @test4 }, { i32, void ()* } { i32 65535, void ()* @test4 }] |