aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll')
-rw-r--r--test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll b/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll
new file mode 100644
index 0000000..ad5b440
--- /dev/null
+++ b/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll
@@ -0,0 +1,16 @@
+; RUN: opt < %s -globalopt -S | FileCheck %s
+
+; PR8389: Globals with weak_odr linkage type must not be modified
+
+; CHECK: weak_odr global i32 0
+
+@SomeVar = weak_odr global i32 0
+
+@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @CTOR } ]
+
+define internal void @CTOR() {
+ store i32 23, i32* @SomeVar
+ ret void
+}
+
+