aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/GlobalOpt/malloc-promote-2.ll4
-rw-r--r--test/Transforms/GlobalOpt/malloc-promote-3.ll4
-rw-r--r--test/Transforms/InstCombine/cast-malloc.ll2
-rw-r--r--test/Transforms/InstCombine/cast.ll6
-rw-r--r--test/Transforms/InstCombine/getelementptr.ll2
-rw-r--r--test/Transforms/InstCombine/malloc-free-delete.ll2
-rw-r--r--test/Transforms/InstCombine/malloc2.ll1
7 files changed, 9 insertions, 12 deletions
diff --git a/test/Transforms/GlobalOpt/malloc-promote-2.ll b/test/Transforms/GlobalOpt/malloc-promote-2.ll
index d3d225260a..0d03835cf5 100644
--- a/test/Transforms/GlobalOpt/malloc-promote-2.ll
+++ b/test/Transforms/GlobalOpt/malloc-promote-2.ll
@@ -1,6 +1,4 @@
-; RUN: opt < %s -globalopt -globaldce -S | not grep malloc
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
+; RUN: opt < %s -globalopt -S | not grep malloc
@G = internal global i32* null ; <i32**> [#uses=3]
diff --git a/test/Transforms/GlobalOpt/malloc-promote-3.ll b/test/Transforms/GlobalOpt/malloc-promote-3.ll
index a920b61150..d4ee4e861c 100644
--- a/test/Transforms/GlobalOpt/malloc-promote-3.ll
+++ b/test/Transforms/GlobalOpt/malloc-promote-3.ll
@@ -1,6 +1,4 @@
-; RUN: opt < %s -globalopt -globaldce -S | not grep malloc
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
+; RUN: opt < %s -globalopt -S | not grep malloc
@G = internal global i32* null ; <i32**> [#uses=4]
diff --git a/test/Transforms/InstCombine/cast-malloc.ll b/test/Transforms/InstCombine/cast-malloc.ll
index 43a1489277..3754032cc2 100644
--- a/test/Transforms/InstCombine/cast-malloc.ll
+++ b/test/Transforms/InstCombine/cast-malloc.ll
@@ -1,6 +1,6 @@
; test that casted mallocs get converted to malloc of the right type
; RUN: opt < %s -instcombine -S | \
-; RUN: grep bitcast | count 1
+; RUN: not grep bitcast
; The target datalayout is important for this test case. We have to tell
; instcombine that the ABI alignment for a long is 4-bytes, not 8, otherwise
diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll
index 27222673f7..59d7cd051d 100644
--- a/test/Transforms/InstCombine/cast.ll
+++ b/test/Transforms/InstCombine/cast.ll
@@ -79,9 +79,9 @@ define void @test11(i32* %P) {
}
define i32* @test12() {
- %c = malloc [4 x i8] ; <[4 x i8]*> [#uses=1]
- %p = bitcast [4 x i8]* %c to i32* ; <i32*> [#uses=1]
- ret i32* %p
+ %p = malloc [4 x i8] ; <[4 x i8]*> [#uses=1]
+ %c = bitcast [4 x i8]* %p to i32* ; <i32*> [#uses=1]
+ ret i32* %c
}
define i8* @test13(i64 %A) {
%c = getelementptr [0 x i8]* bitcast ([32832 x i8]* @inbuf to [0 x i8]*), i64 0, i64 %A ; <i8*> [#uses=1]
diff --git a/test/Transforms/InstCombine/getelementptr.ll b/test/Transforms/InstCombine/getelementptr.ll
index 285e0ba602..ffaa6afa85 100644
--- a/test/Transforms/InstCombine/getelementptr.ll
+++ b/test/Transforms/InstCombine/getelementptr.ll
@@ -58,7 +58,7 @@ define i32* @test6() {
%B = getelementptr i32* %A, i64 2
ret i32* %B
; CHECK: @test6
-; CHECK: getelementptr i8* %malloccall, i64 8
+; CHECK: getelementptr [4 x i32]* %M, i64 0, i64 2
}
define i32* @test7(i32* %I, i64 %C, i64 %D) {
diff --git a/test/Transforms/InstCombine/malloc-free-delete.ll b/test/Transforms/InstCombine/malloc-free-delete.ll
index fd91e447bd..2ed5ec6996 100644
--- a/test/Transforms/InstCombine/malloc-free-delete.ll
+++ b/test/Transforms/InstCombine/malloc-free-delete.ll
@@ -1,5 +1,5 @@
; RUN: opt < %s -instcombine -S | grep {ret i32 0}
-; RUN: opt < %s -instcombine -globaldce -S | not grep malloc
+; RUN: opt < %s -instcombine -S | not grep malloc
; PR1201
define i32 @main(i32 %argc, i8** %argv) {
%c_19 = alloca i8* ; <i8**> [#uses=2]
diff --git a/test/Transforms/InstCombine/malloc2.ll b/test/Transforms/InstCombine/malloc2.ll
index cc1506b6b1..102422ee5f 100644
--- a/test/Transforms/InstCombine/malloc2.ll
+++ b/test/Transforms/InstCombine/malloc2.ll
@@ -1,4 +1,5 @@
; RUN: opt < %s -instcombine -S | grep {ret i32 0}
+; RUN: opt < %s -instcombine -S | not grep malloc
; PR1313
define i32 @test1(i32 %argc, i8* %argv, i8* %envp) {