summaryrefslogtreecommitdiffstats
path: root/test/Transforms/GlobalOpt
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/GlobalOpt')
-rw-r--r--test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll2
-rw-r--r--test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll2
-rw-r--r--test/Transforms/GlobalOpt/2005-09-27-Crash.ll2
-rw-r--r--test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll2
-rw-r--r--test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll2
-rw-r--r--test/Transforms/GlobalOpt/2007-04-05-Crash.ll2
-rw-r--r--test/Transforms/GlobalOpt/2007-05-13-Crash.ll2
-rw-r--r--test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll2
-rw-r--r--test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll2
-rw-r--r--test/Transforms/GlobalOpt/2008-01-03-Crash.ll2
-rw-r--r--test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll2
-rw-r--r--test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll2
-rw-r--r--test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll2
-rw-r--r--test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll6
-rw-r--r--test/Transforms/GlobalOpt/2008-07-17-addrspace.ll2
-rw-r--r--test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll2
-rw-r--r--test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll2
-rw-r--r--test/Transforms/GlobalOpt/2009-01-13-phi-user.ll2
-rw-r--r--test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll2
-rw-r--r--test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll2
-rw-r--r--test/Transforms/GlobalOpt/2009-03-03-dbg.ll2
-rw-r--r--test/Transforms/GlobalOpt/2009-03-05-dbg.ll2
-rw-r--r--test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll2
-rw-r--r--test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll2
-rw-r--r--test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll2
-rw-r--r--test/Transforms/GlobalOpt/alias-resolve.ll2
-rw-r--r--test/Transforms/GlobalOpt/basictest.ll2
-rw-r--r--test/Transforms/GlobalOpt/constantexpr-dangle.ll2
-rw-r--r--test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll6
-rw-r--r--test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll23
-rw-r--r--test/Transforms/GlobalOpt/ctor-list-opt.ll6
-rw-r--r--test/Transforms/GlobalOpt/deadglobal-2.ll2
-rw-r--r--test/Transforms/GlobalOpt/deadglobal.ll2
-rw-r--r--test/Transforms/GlobalOpt/globalsra-partial.ll2
-rw-r--r--test/Transforms/GlobalOpt/globalsra-unknown-index.ll41
-rw-r--r--test/Transforms/GlobalOpt/globalsra.ll2
-rw-r--r--test/Transforms/GlobalOpt/heap-sra-1.ll4
-rw-r--r--test/Transforms/GlobalOpt/heap-sra-2.ll4
-rw-r--r--test/Transforms/GlobalOpt/heap-sra-phi.ll4
-rw-r--r--test/Transforms/GlobalOpt/integer-bool.ll2
-rw-r--r--test/Transforms/GlobalOpt/iterate.ll2
-rw-r--r--test/Transforms/GlobalOpt/load-store-global.ll2
-rw-r--r--test/Transforms/GlobalOpt/malloc-promote-1.ll2
-rw-r--r--test/Transforms/GlobalOpt/malloc-promote-2.ll2
-rw-r--r--test/Transforms/GlobalOpt/malloc-promote-3.ll2
-rw-r--r--test/Transforms/GlobalOpt/memcpy.ll2
-rw-r--r--test/Transforms/GlobalOpt/memset.ll2
-rw-r--r--test/Transforms/GlobalOpt/phi-select.ll2
-rw-r--r--test/Transforms/GlobalOpt/storepointer-compare.ll2
-rw-r--r--test/Transforms/GlobalOpt/storepointer.ll2
-rw-r--r--test/Transforms/GlobalOpt/trivialstore.ll2
-rw-r--r--test/Transforms/GlobalOpt/undef-init.ll2
52 files changed, 123 insertions, 59 deletions
diff --git a/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll b/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll
index 5f784e0..bdcf1fa 100644
--- a/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll
+++ b/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt
+; RUN: opt < %s -globalopt
@V = global float 1.200000e+01 ; <float*> [#uses=1]
@G = internal global i32* null ; <i32**> [#uses=2]
diff --git a/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll b/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll
index 80f8243..7bcb1d4 100644
--- a/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll
+++ b/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
+; RUN: opt < %s -globalopt -disable-output
; PR579
@g_40507551 = internal global i16 31038 ; <i16*> [#uses=1]
diff --git a/test/Transforms/GlobalOpt/2005-09-27-Crash.ll b/test/Transforms/GlobalOpt/2005-09-27-Crash.ll
index 5eac431..ab2077a 100644
--- a/test/Transforms/GlobalOpt/2005-09-27-Crash.ll
+++ b/test/Transforms/GlobalOpt/2005-09-27-Crash.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
+; RUN: opt < %s -globalopt -disable-output
%RPyString = type { i32, %arraytype.Char }
%arraytype.Char = type { i32, [0 x i8] }
%arraytype.Signed = type { i32, [0 x i32] }
diff --git a/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll b/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll
index 5559ef1..c971219 100644
--- a/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll
+++ b/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
+; RUN: opt < %s -globalopt -disable-output
; PR820
target datalayout = "e-p:32:32"
target triple = "i686-pc-linux-gnu"
diff --git a/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll b/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll
index 39be6c4..352639a 100644
--- a/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll
+++ b/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
+; RUN: opt < %s -globalopt -disable-output
%struct._list = type { i32*, %struct._list* }
%struct._play = type { i32, i32*, %struct._list*, %struct._play* }
diff --git a/test/Transforms/GlobalOpt/2007-04-05-Crash.ll b/test/Transforms/GlobalOpt/2007-04-05-Crash.ll
index 1991d90..d306d14 100644
--- a/test/Transforms/GlobalOpt/2007-04-05-Crash.ll
+++ b/test/Transforms/GlobalOpt/2007-04-05-Crash.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
+; RUN: opt < %s -globalopt -disable-output
target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32"
target triple = "thumb-apple-darwin8"
diff --git a/test/Transforms/GlobalOpt/2007-05-13-Crash.ll b/test/Transforms/GlobalOpt/2007-05-13-Crash.ll
index 22fee77..5703909 100644
--- a/test/Transforms/GlobalOpt/2007-05-13-Crash.ll
+++ b/test/Transforms/GlobalOpt/2007-05-13-Crash.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
+; RUN: opt < %s -globalopt -disable-output
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"
target triple = "i686-apple-darwin8"
diff --git a/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll b/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll
index 7394f04..7036c15 100644
--- a/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll
+++ b/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
+; RUN: opt < %s -globalopt -disable-output
; PR1491
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"
diff --git a/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll b/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll
index 0d7d036..442cb92 100644
--- a/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll
+++ b/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
+; RUN: opt < %s -globalopt -disable-output
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-f128:64:128"
target triple = "powerpc-apple-darwin8"
%struct.empty0 = type { }
diff --git a/test/Transforms/GlobalOpt/2008-01-03-Crash.ll b/test/Transforms/GlobalOpt/2008-01-03-Crash.ll
index 3d8c77d..4105ab1 100644
--- a/test/Transforms/GlobalOpt/2008-01-03-Crash.ll
+++ b/test/Transforms/GlobalOpt/2008-01-03-Crash.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis
+; RUN: opt < %s -globalopt | llvm-dis
; PR1896
@indirect1 = internal global void (i32)* null ; <void (i32)**> [#uses=2]
diff --git a/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll b/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll
index aace346..82abc8fe 100644
--- a/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll
+++ b/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {16 x .31 x double.. zeroinitializer}
+; RUN: opt < %s -globalopt -S | grep {16 x .31 x double.. zeroinitializer}
; The 'X' indices could be larger than 31. Do not SROA the outer indices of this array.
@mm = internal global [16 x [31 x double]] zeroinitializer, align 32
diff --git a/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll b/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll
index 779e7fb..0c81700 100644
--- a/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll
+++ b/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {volatile load}
+; RUN: opt < %s -globalopt -S | grep {volatile load}
@t0.1441 = internal global double 0x3FD5555555555555, align 8 ; <double*> [#uses=1]
define double @foo() nounwind {
diff --git a/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll b/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll
index 59996c5..0e70c49 100644
--- a/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll
+++ b/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep { nest } | count 1
+; RUN: opt < %s -globalopt -S | grep { nest } | count 1
%struct.FRAME.nest = type { i32, i32 (i32)* }
%struct.__builtin_trampoline = type { [10 x i8] }
@.str = internal constant [7 x i8] c"%d %d\0A\00" ; <[7 x i8]*> [#uses=1]
diff --git a/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll b/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll
index 8a0b5b3..cfc9f30 100644
--- a/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll
+++ b/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll
@@ -2,9 +2,9 @@
; alignments. Elements 0 and 2 must be 16-byte aligned, and element
; 1 must be at least 8 byte aligned (but could be more).
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@G.0 = internal global .*align 16}
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@G.1 = internal global .*align 8}
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@G.2 = internal global .*align 16}
+; RUN: opt < %s -globalopt -S | grep {@G.0 = internal global .*align 16}
+; RUN: opt < %s -globalopt -S | grep {@G.1 = internal global .*align 8}
+; RUN: opt < %s -globalopt -S | grep {@G.2 = internal global .*align 16}
; rdar://5891920
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:32:32-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
diff --git a/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll b/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll
index 735a84d..5e64f80 100644
--- a/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll
+++ b/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll
@@ -2,7 +2,7 @@
; values. This used to crash, because globalopt forgot to put the new var in the
; same address space as the old one.
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis > %t
+; RUN: opt < %s -globalopt -S > %t
; Check that the new global values still have their address space
; RUN: cat %t | grep global.*addrspace
diff --git a/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll b/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll
index cdc2771..3242e1e 100644
--- a/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll
+++ b/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis
+; RUN: opt < %s -globalopt | llvm-dis
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 = "i386-apple-darwin7"
%struct.foo = type { i32, i32 }
diff --git a/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll b/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll
index f284840..51dcac1 100644
--- a/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll
+++ b/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis
+; RUN: opt < %s -globalopt | llvm-dis
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 = "i386-apple-darwin7"
%struct.foo = type { i32, i32 }
diff --git a/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll b/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll
index 03ec3b6..c4b6e52 100644
--- a/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll
+++ b/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {phi.*@head}
+; RUN: opt < %s -globalopt -S | grep {phi.*@head}
; PR3321
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"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll b/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll
index e59c8df..a1b69ef 100644
--- a/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll
+++ b/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt
+; RUN: opt < %s -globalopt
@g = external global i32
diff --git a/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll b/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll
index f042e59..5e639fd 100644
--- a/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll
+++ b/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {define void @a}
+; RUN: opt < %s -globalopt -S | grep {define void @a}
define internal void @f() {
ret void
diff --git a/test/Transforms/GlobalOpt/2009-03-03-dbg.ll b/test/Transforms/GlobalOpt/2009-03-03-dbg.ll
index 1996f62..070f89f 100644
--- a/test/Transforms/GlobalOpt/2009-03-03-dbg.ll
+++ b/test/Transforms/GlobalOpt/2009-03-03-dbg.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global_variable42
+; RUN: opt < %s -globalopt -S | not grep global_variable42
; XFAIL: *
%llvm.dbg.anchor.type = type { i32, i32 }
diff --git a/test/Transforms/GlobalOpt/2009-03-05-dbg.ll b/test/Transforms/GlobalOpt/2009-03-05-dbg.ll
index 30e9a63..a5f9ed3 100644
--- a/test/Transforms/GlobalOpt/2009-03-05-dbg.ll
+++ b/test/Transforms/GlobalOpt/2009-03-05-dbg.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt -stats -disable-output |& grep "1 globalopt - Number of global vars shrunk to booleans"
+; RUN: opt < %s -globalopt -stats -disable-output |& grep "1 globalopt - Number of global vars shrunk to booleans"
; XFAIL: *
type { } ; type %0
diff --git a/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll b/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll
index ea13d29..62f75e1 100644
--- a/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll
+++ b/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep internal | count 2
+; RUN: opt < %s -globalopt -S | grep internal | count 2
global i32 0
define i32* @1() {
diff --git a/test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll b/test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll
index 8dba5b1..e024fc2 100644
--- a/test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll
+++ b/test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@X = internal global i32}
+; RUN: opt < %s -globalopt -S | grep {@X = internal global i32}
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 = "i386-apple-darwin7"
@X = internal global i32* null ; <i32**> [#uses=2]
diff --git a/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll b/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll
index 0ce16dd..abd3109 100644
--- a/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll
+++ b/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt
+; RUN: opt < %s -globalopt
%struct.s_annealing_sched = type { i32, float, float, float, float }
%struct.s_bb = type { i32, i32, i32, i32 }
diff --git a/test/Transforms/GlobalOpt/alias-resolve.ll b/test/Transforms/GlobalOpt/alias-resolve.ll
index 3cae413..8451179 100644
--- a/test/Transforms/GlobalOpt/alias-resolve.ll
+++ b/test/Transforms/GlobalOpt/alias-resolve.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis > %t
+; RUN: opt < %s -globalopt -S > %t
; RUN: cat %t | grep foo1 | count 1
; RUN: cat %t | grep foo2 | count 4
; RUN: cat %t | grep bar1 | count 1
diff --git a/test/Transforms/GlobalOpt/basictest.ll b/test/Transforms/GlobalOpt/basictest.ll
index 1c3bdbb..4332d3d 100644
--- a/test/Transforms/GlobalOpt/basictest.ll
+++ b/test/Transforms/GlobalOpt/basictest.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global
+; RUN: opt < %s -globalopt -S | not grep global
@X = internal global i32 4 ; <i32*> [#uses=1]
diff --git a/test/Transforms/GlobalOpt/constantexpr-dangle.ll b/test/Transforms/GlobalOpt/constantexpr-dangle.ll
index 6fa139b..099c607 100644
--- a/test/Transforms/GlobalOpt/constantexpr-dangle.ll
+++ b/test/Transforms/GlobalOpt/constantexpr-dangle.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -instcombine -globalopt | llvm-dis | \
+; RUN: opt < %s -instcombine -globalopt -S | \
; RUN: grep {internal fastcc float @foo}
define internal float @foo() {
diff --git a/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll b/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll
index 45fb453..5fe89ee 100644
--- a/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll
+++ b/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep CTOR
+; RUN: opt < %s -globalopt -S | not grep CTOR
@llvm.global_ctors = appending global [10 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @CTOR1 }, { i32, void ()* } { i32 65535, void ()* @CTOR1 }, { i32, void ()* } { i32 65535, void ()* @CTOR2 }, { i32, void ()* } { i32 65535, void ()* @CTOR3 }, { i32, void ()* } { i32 65535, void ()* @CTOR4 }, { i32, void ()* } { i32 65535, void ()* @CTOR5 }, { i32, void ()* } { i32 65535, void ()* @CTOR6 }, { i32, void ()* } { i32 65535, void ()* @CTOR7 }, { i32, void ()* } { i32 65535, void ()* @CTOR8 }, { i32, void ()* } { i32 2147483647, void ()* null } ] ; <[10 x { i32, void ()* }]*> [#uses=0]
@G = global i32 0 ; <i32*> [#uses=1]
@G2 = global i32 0 ; <i32*> [#uses=1]
@@ -56,9 +56,9 @@ define internal void @CTOR4() {
}
define internal void @CTOR5() {
- %X.2p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2]
+ %X.2p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2]
%X.2 = load i32* %X.2p ; <i32> [#uses=1]
- %X.1p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1]
+ %X.1p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1]
store i32 %X.2, i32* %X.1p
store i32 42, i32* %X.2p
ret void
diff --git a/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll b/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll
new file mode 100644
index 0000000..9b11985
--- /dev/null
+++ b/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll
@@ -0,0 +1,23 @@
+; RUN: opt < %s -globalopt -S | FileCheck %s
+
+; Don't get fooled by the inbounds keyword; it doesn't change
+; the computed address.
+
+; CHECK: @H = global i32 2
+; CHECK: @I = global i32 2
+
+@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @CTOR } ]
+@addr = external global i32
+@G = internal global [6 x [5 x i32]] zeroinitializer
+@H = global i32 80
+@I = global i32 90
+
+define internal void @CTOR() {
+ store i32 1, i32* getelementptr ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0)
+ store i32 2, i32* getelementptr inbounds ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0)
+ %t = load i32* getelementptr ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0)
+ store i32 %t, i32* @H
+ %s = load i32* getelementptr inbounds ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0)
+ store i32 %s, i32* @I
+ ret void
+}
diff --git a/test/Transforms/GlobalOpt/ctor-list-opt.ll b/test/Transforms/GlobalOpt/ctor-list-opt.ll
index 56aeadb..887e7ee 100644
--- a/test/Transforms/GlobalOpt/ctor-list-opt.ll
+++ b/test/Transforms/GlobalOpt/ctor-list-opt.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep CTOR
+; RUN: opt < %s -globalopt -S | not grep CTOR
@llvm.global_ctors = appending global [10 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @CTOR1 }, { i32, void ()* } { i32 65535, void ()* @CTOR1 }, { i32, void ()* } { i32 65535, void ()* @CTOR2 }, { i32, void ()* } { i32 65535, void ()* @CTOR3 }, { i32, void ()* } { i32 65535, void ()* @CTOR4 }, { i32, void ()* } { i32 65535, void ()* @CTOR5 }, { i32, void ()* } { i32 65535, void ()* @CTOR6 }, { i32, void ()* } { i32 65535, void ()* @CTOR7 }, { i32, void ()* } { i32 65535, void ()* @CTOR8 }, { i32, void ()* } { i32 2147483647, void ()* null } ] ; <[10 x { i32, void ()* }]*> [#uses=0]
@G = global i32 0 ; <i32*> [#uses=1]
@G2 = global i32 0 ; <i32*> [#uses=1]
@@ -43,9 +43,9 @@ define internal void @CTOR4() {
}
define internal void @CTOR5() {
- %X.2p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2]
+ %X.2p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2]
%X.2 = load i32* %X.2p ; <i32> [#uses=1]
- %X.1p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1]
+ %X.1p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1]
store i32 %X.2, i32* %X.1p
store i32 42, i32* %X.2p
ret void
diff --git a/test/Transforms/GlobalOpt/deadglobal-2.ll b/test/Transforms/GlobalOpt/deadglobal-2.ll
index def6a09..4f81819 100644
--- a/test/Transforms/GlobalOpt/deadglobal-2.ll
+++ b/test/Transforms/GlobalOpt/deadglobal-2.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep internal
+; RUN: opt < %s -globalopt -S | not grep internal
; This is a harder case to delete as the GEP has a variable index.
diff --git a/test/Transforms/GlobalOpt/deadglobal.ll b/test/Transforms/GlobalOpt/deadglobal.ll
index 7a47b8e..c8d8e76 100644
--- a/test/Transforms/GlobalOpt/deadglobal.ll
+++ b/test/Transforms/GlobalOpt/deadglobal.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep internal
+; RUN: opt < %s -globalopt -S | not grep internal
@G = internal global i32 123 ; <i32*> [#uses=1]
diff --git a/test/Transforms/GlobalOpt/globalsra-partial.ll b/test/Transforms/GlobalOpt/globalsra-partial.ll
index e52e7fe..9a068e9 100644
--- a/test/Transforms/GlobalOpt/globalsra-partial.ll
+++ b/test/Transforms/GlobalOpt/globalsra-partial.ll
@@ -1,6 +1,6 @@
; In this case, the global can only be broken up by one level.
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep 12345
+; RUN: opt < %s -globalopt -S | not grep 12345
@G = internal global { i32, [4 x float] } zeroinitializer ; <{ i32, [4 x float] }*> [#uses=3]
diff --git a/test/Transforms/GlobalOpt/globalsra-unknown-index.ll b/test/Transforms/GlobalOpt/globalsra-unknown-index.ll
new file mode 100644
index 0000000..9397a12
--- /dev/null
+++ b/test/Transforms/GlobalOpt/globalsra-unknown-index.ll
@@ -0,0 +1,41 @@
+; RUN: opt < %s -globalopt -S > %t
+; RUN: grep {@Y = internal global \\\[3 x \[%\]struct.X\\\] zeroinitializer} %t
+; RUN: grep load %t | count 6
+; RUN: grep {add i32 \[%\]a, \[%\]b} %t | count 3
+
+; globalopt should not sra the global, because it can't see the index.
+
+%struct.X = type { [3 x i32], [3 x i32] }
+
+@Y = internal global [3 x %struct.X] zeroinitializer
+
+@addr = external global i8
+
+define void @frob() {
+ store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 ptrtoint (i8* @addr to i64)), align 4
+ ret void
+}
+define i32 @borf(i64 %i, i64 %j) {
+ %p = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 0
+ %a = load i32* %p
+ %q = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 0
+ %b = load i32* %q
+ %c = add i32 %a, %b
+ ret i32 %c
+}
+define i32 @borg(i64 %i, i64 %j) {
+ %p = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 1
+ %a = load i32* %p
+ %q = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 1
+ %b = load i32* %q
+ %c = add i32 %a, %b
+ ret i32 %c
+}
+define i32 @borh(i64 %i, i64 %j) {
+ %p = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 2
+ %a = load i32* %p
+ %q = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 2
+ %b = load i32* %q
+ %c = add i32 %a, %b
+ ret i32 %c
+}
diff --git a/test/Transforms/GlobalOpt/globalsra.ll b/test/Transforms/GlobalOpt/globalsra.ll
index 3623555..276ca64 100644
--- a/test/Transforms/GlobalOpt/globalsra.ll
+++ b/test/Transforms/GlobalOpt/globalsra.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global
+; RUN: opt < %s -globalopt -S | not grep global
@G = internal global { i32, float, { double } } {
i32 1,
diff --git a/test/Transforms/GlobalOpt/heap-sra-1.ll b/test/Transforms/GlobalOpt/heap-sra-1.ll
index 37e6d47..6df559e 100644
--- a/test/Transforms/GlobalOpt/heap-sra-1.ll
+++ b/test/Transforms/GlobalOpt/heap-sra-1.ll
@@ -1,5 +1,5 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@X.f0}
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@X.f1}
+; RUN: opt < %s -globalopt -S | grep {@X.f0}
+; RUN: opt < %s -globalopt -S | grep {@X.f1}
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 = "i386-apple-darwin7"
diff --git a/test/Transforms/GlobalOpt/heap-sra-2.ll b/test/Transforms/GlobalOpt/heap-sra-2.ll
index 98f4a50..5a3c3cd1 100644
--- a/test/Transforms/GlobalOpt/heap-sra-2.ll
+++ b/test/Transforms/GlobalOpt/heap-sra-2.ll
@@ -1,5 +1,5 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@X.f0}
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@X.f1}
+; RUN: opt < %s -globalopt -S | grep {@X.f0}
+; RUN: opt < %s -globalopt -S | grep {@X.f1}
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 = "i386-apple-darwin7"
diff --git a/test/Transforms/GlobalOpt/heap-sra-phi.ll b/test/Transforms/GlobalOpt/heap-sra-phi.ll
index 5f46a77..2eba944 100644
--- a/test/Transforms/GlobalOpt/heap-sra-phi.ll
+++ b/test/Transforms/GlobalOpt/heap-sra-phi.ll
@@ -1,5 +1,5 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {tmp.f1 = phi i32. }
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {tmp.f0 = phi i32. }
+; RUN: opt < %s -globalopt -S | grep {tmp.f1 = phi i32. }
+; RUN: opt < %s -globalopt -S | grep {tmp.f0 = phi i32. }
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 = "i386-apple-darwin7"
diff --git a/test/Transforms/GlobalOpt/integer-bool.ll b/test/Transforms/GlobalOpt/integer-bool.ll
index 9fbbe35..59403b1 100644
--- a/test/Transforms/GlobalOpt/integer-bool.ll
+++ b/test/Transforms/GlobalOpt/integer-bool.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt -instcombine | \
+; RUN: opt < %s -globalopt -instcombine | \
; RUN: llvm-dis | grep {ret i1 true}
;; check that global opt turns integers that only hold 0 or 1 into bools.
diff --git a/test/Transforms/GlobalOpt/iterate.ll b/test/Transforms/GlobalOpt/iterate.ll
index d764c5d..7466874 100644
--- a/test/Transforms/GlobalOpt/iterate.ll
+++ b/test/Transforms/GlobalOpt/iterate.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep %G
+; RUN: opt < %s -globalopt -S | not grep %G
@G = internal global i32 0 ; <i32*> [#uses=1]
@H = internal global { i32* } { i32* @G } ; <{ i32* }*> [#uses=1]
diff --git a/test/Transforms/GlobalOpt/load-store-global.ll b/test/Transforms/GlobalOpt/load-store-global.ll
index d89d226..f824b2c 100644
--- a/test/Transforms/GlobalOpt/load-store-global.ll
+++ b/test/Transforms/GlobalOpt/load-store-global.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep G
+; RUN: opt < %s -globalopt -S | not grep G
@G = internal global i32 17 ; <i32*> [#uses=3]
diff --git a/test/Transforms/GlobalOpt/malloc-promote-1.ll b/test/Transforms/GlobalOpt/malloc-promote-1.ll
index fea4dbd..5d4696f 100644
--- a/test/Transforms/GlobalOpt/malloc-promote-1.ll
+++ b/test/Transforms/GlobalOpt/malloc-promote-1.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global
+; RUN: opt < %s -globalopt -S | not grep global
@G = internal global i32* null ; <i32**> [#uses=3]
diff --git a/test/Transforms/GlobalOpt/malloc-promote-2.ll b/test/Transforms/GlobalOpt/malloc-promote-2.ll
index 1b33632..0d03835 100644
--- a/test/Transforms/GlobalOpt/malloc-promote-2.ll
+++ b/test/Transforms/GlobalOpt/malloc-promote-2.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep malloc
+; 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 26ce8fd..d4ee4e8 100644
--- a/test/Transforms/GlobalOpt/malloc-promote-3.ll
+++ b/test/Transforms/GlobalOpt/malloc-promote-3.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep malloc
+; RUN: opt < %s -globalopt -S | not grep malloc
@G = internal global i32* null ; <i32**> [#uses=4]
diff --git a/test/Transforms/GlobalOpt/memcpy.ll b/test/Transforms/GlobalOpt/memcpy.ll
index b51aedb..335f5ec 100644
--- a/test/Transforms/GlobalOpt/memcpy.ll
+++ b/test/Transforms/GlobalOpt/memcpy.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \
+; RUN: opt < %s -globalopt -S | \
; RUN: grep {G1 = internal constant}
@G1 = internal global [58 x i8] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00" ; <[58 x i8]*> [#uses=1]
diff --git a/test/Transforms/GlobalOpt/memset.ll b/test/Transforms/GlobalOpt/memset.ll
index 0ee851f..a9b9d5e 100644
--- a/test/Transforms/GlobalOpt/memset.ll
+++ b/test/Transforms/GlobalOpt/memset.ll
@@ -1,6 +1,6 @@
; both globals are write only, delete them.
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \
+; RUN: opt < %s -globalopt -S | \
; RUN: not grep internal
@G0 = internal global [58 x i8] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00" ; <[58 x i8]*> [#uses=1]
diff --git a/test/Transforms/GlobalOpt/phi-select.ll b/test/Transforms/GlobalOpt/phi-select.ll
index da1314f7..cd8a7dc 100644
--- a/test/Transforms/GlobalOpt/phi-select.ll
+++ b/test/Transforms/GlobalOpt/phi-select.ll
@@ -1,7 +1,7 @@
; Test that PHI nodes and select instructions do not necessarily make stuff
; non-constant.
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global
+; RUN: opt < %s -globalopt -S | not grep global
@X = internal global i32 4 ; <i32*> [#uses=2]
@Y = internal global i32 5 ; <i32*> [#uses=2]
diff --git a/test/Transforms/GlobalOpt/storepointer-compare.ll b/test/Transforms/GlobalOpt/storepointer-compare.ll
index 86eff51..2f5ae86 100644
--- a/test/Transforms/GlobalOpt/storepointer-compare.ll
+++ b/test/Transforms/GlobalOpt/storepointer-compare.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \
+; RUN: opt < %s -globalopt -S | \
; RUN: grep {call void @Actual}
; Check that a comparison does not prevent an indirect call from being made
diff --git a/test/Transforms/GlobalOpt/storepointer.ll b/test/Transforms/GlobalOpt/storepointer.ll
index d57a6ac..8019076 100644
--- a/test/Transforms/GlobalOpt/storepointer.ll
+++ b/test/Transforms/GlobalOpt/storepointer.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global
+; RUN: opt < %s -globalopt -S | not grep global
@G = internal global void ()* null ; <void ()**> [#uses=2]
diff --git a/test/Transforms/GlobalOpt/trivialstore.ll b/test/Transforms/GlobalOpt/trivialstore.ll
index a662565..21437f3 100644
--- a/test/Transforms/GlobalOpt/trivialstore.ll
+++ b/test/Transforms/GlobalOpt/trivialstore.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep G
+; RUN: opt < %s -globalopt -S | not grep G
@G = internal global i32 17 ; <i32*> [#uses=3]
diff --git a/test/Transforms/GlobalOpt/undef-init.ll b/test/Transforms/GlobalOpt/undef-init.ll
index bb483fc..c149497 100644
--- a/test/Transforms/GlobalOpt/undef-init.ll
+++ b/test/Transforms/GlobalOpt/undef-init.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep store
+; RUN: opt < %s -globalopt -S | not grep store
@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__Z3foov } ] ; <[1 x { i32, void ()* }]*> [#uses=0]
@X.0 = internal global i32 undef ; <i32*> [#uses=2]
OpenPOWER on IntegriCloud