aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2012-02-20 23:32:26 +0000
committerNick Lewycky <nicholas@mxc.ca>2012-02-20 23:32:26 +0000
commit0ef0557ab5cd11f56c16e82551d4f3b58bb2507a (patch)
treee15644f32031da9633d2bab76ccb75a228af3a4c /test
parent01b623c8c2d1bd015a8bb20eafee3322575eff8f (diff)
downloadexternal_llvm-0ef0557ab5cd11f56c16e82551d4f3b58bb2507a.zip
external_llvm-0ef0557ab5cd11f56c16e82551d4f3b58bb2507a.tar.gz
external_llvm-0ef0557ab5cd11f56c16e82551d4f3b58bb2507a.tar.bz2
Check for the correct size in the invariant marker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151003 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/GlobalOpt/invariant.ll34
1 files changed, 30 insertions, 4 deletions
diff --git a/test/Transforms/GlobalOpt/invariant.ll b/test/Transforms/GlobalOpt/invariant.ll
index 687dc83..6b99193 100644
--- a/test/Transforms/GlobalOpt/invariant.ll
+++ b/test/Transforms/GlobalOpt/invariant.ll
@@ -1,9 +1,12 @@
; RUN: opt -globalopt -S -o - < %s | FileCheck %s
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
declare {}* @llvm.invariant.start(i64 %size, i8* nocapture %ptr)
define void @test1(i8* %ptr) {
- call {}* @llvm.invariant.start(i64 -1, i8* %ptr)
+ call {}* @llvm.invariant.start(i64 4, i8* %ptr)
ret void
}
@@ -22,12 +25,35 @@ define void @ctor1() {
define void @ctor2() {
store i32 -1, i32* @object2
%A = bitcast i32* @object2 to i8*
- %B = call {}* @llvm.invariant.start(i64 -1, i8* %A)
+ %B = call {}* @llvm.invariant.start(i64 4, i8* %A)
%C = bitcast {}* %B to i8*
ret void
}
+
+@object3 = global i32 0
+; CHECK: @object3 = global i32 -1
+define void @ctor3() {
+ store i32 -1, i32* @object3
+ %A = bitcast i32* @object3 to i8*
+ call {}* @llvm.invariant.start(i64 3, i8* %A)
+ ret void
+}
+
+
+@object4 = global i32 0
+; CHECK: @object4 = global i32 -1
+define void @ctor4() {
+ store i32 -1, i32* @object4
+ %A = bitcast i32* @object4 to i8*
+ call {}* @llvm.invariant.start(i64 -1, i8* %A)
+ ret void
+}
+
+
@llvm.global_ctors = appending constant
- [2 x { i32, void ()* }]
+ [4 x { i32, void ()* }]
[ { i32, void ()* } { i32 65535, void ()* @ctor1 },
- { i32, void ()* } { i32 65535, void ()* @ctor2 } ]
+ { i32, void ()* } { i32 65535, void ()* @ctor2 },
+ { i32, void ()* } { i32 65535, void ()* @ctor3 },
+ { i32, void ()* } { i32 65535, void ()* @ctor4 } ]