aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/GlobalOpt
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/GlobalOpt')
-rw-r--r--test/Transforms/GlobalOpt/2008-07-17-addrspace.ll2
-rw-r--r--test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll16
-rw-r--r--test/Transforms/GlobalOpt/crash.ll15
-rw-r--r--test/Transforms/GlobalOpt/ctor-list-opt.ll2
4 files changed, 33 insertions, 2 deletions
diff --git a/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll b/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll
index 5e64f80..390e77a 100644
--- a/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll
+++ b/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll
@@ -4,7 +4,7 @@
; RUN: opt < %s -globalopt -S > %t
; Check that the new global values still have their address space
-; RUN: cat %t | grep global.*addrspace
+; RUN: cat %t | grep addrspace.*global
@struct = internal addrspace(1) global { i32, i32 } zeroinitializer
@array = internal addrspace(1) global [ 2 x i32 ] zeroinitializer
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
+}
+
+
diff --git a/test/Transforms/GlobalOpt/crash.ll b/test/Transforms/GlobalOpt/crash.ll
index 701472c..bb1fc84 100644
--- a/test/Transforms/GlobalOpt/crash.ll
+++ b/test/Transforms/GlobalOpt/crash.ll
@@ -40,3 +40,18 @@ xx:
}
declare noalias i8* @malloc(i64) nounwind
+
+
+; PR8063
+@permute_bitrev.bitrev = internal global i32* null, align 8
+define void @permute_bitrev() nounwind {
+entry:
+ %tmp = load i32** @permute_bitrev.bitrev, align 8
+ %conv = sext i32 0 to i64
+ %mul = mul i64 %conv, 4
+ %call = call i8* @malloc(i64 %mul)
+ %0 = bitcast i8* %call to i32*
+ store i32* %0, i32** @permute_bitrev.bitrev, align 8
+ ret void
+}
+
diff --git a/test/Transforms/GlobalOpt/ctor-list-opt.ll b/test/Transforms/GlobalOpt/ctor-list-opt.ll
index 887e7ee..7e90bc1 100644
--- a/test/Transforms/GlobalOpt/ctor-list-opt.ll
+++ b/test/Transforms/GlobalOpt/ctor-list-opt.ll
@@ -74,7 +74,7 @@ define void @setto(i32* %P, i32 %V) {
declare double @cos(double)
define internal void @CTOR8() {
- %X = call double @cos( double 1.000000e+00 ) ; <double> [#uses=1]
+ %X = call double @cos( double 0.000000e+00 ) ; <double> [#uses=1]
store double %X, double* @D
ret void
}