[llvm-commits] CVS: llvm/test/Regression/Transforms/GlobalOpt/ctor-list-opt.ll
Chris Lattner
lattner at cs.uiuc.edu
Sun Sep 25 23:52:01 PDT 2005
Changes in directory llvm/test/Regression/Transforms/GlobalOpt:
ctor-list-opt.ll updated: 1.4 -> 1.5
---
Log message:
add another case, this one that uses getelementptr instructions
---
Diffs of the changes: (+13 -1)
ctor-list-opt.ll | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletion(-)
Index: llvm/test/Regression/Transforms/GlobalOpt/ctor-list-opt.ll
diff -u llvm/test/Regression/Transforms/GlobalOpt/ctor-list-opt.ll:1.4 llvm/test/Regression/Transforms/GlobalOpt/ctor-list-opt.ll:1.5
--- llvm/test/Regression/Transforms/GlobalOpt/ctor-list-opt.ll:1.4 Mon Sep 26 00:14:48 2005
+++ llvm/test/Regression/Transforms/GlobalOpt/ctor-list-opt.ll Mon Sep 26 01:51:50 2005
@@ -1,12 +1,13 @@
; RUN: llvm-as < %s | opt -globalopt -disable-output &&
; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep CTOR
-%llvm.global_ctors = appending global [6 x { int, void ()* }] [
+%llvm.global_ctors = appending global [7 x { int, void ()* }] [
{ int, void ()* } { int 65535, void ()* %CTOR1 },
{ int, void ()* } { int 65535, void ()* %CTOR1 },
{ int, void ()* } { int 65535, void ()* %CTOR2 },
{ int, void ()* } { int 65535, void ()* %CTOR3 },
{ int, void ()* } { int 65535, void ()* %CTOR4 },
+ { int, void ()* } { int 65535, void ()* %CTOR5 },
{ int, void ()* } { int 2147483647, void ()* null }
]
@@ -14,6 +15,8 @@
%G2 = global int 0
%G3 = global int -123
+%X = global {int, [2 x int]} { int 0, [2 x int] [ int 17, int 21] }
+
%CTORGV = internal global bool false ;; Should become constant after eval
implementation
@@ -48,6 +51,15 @@
ret void
}
+internal void %CTOR5() {
+ %X.2p = getelementptr {int,[2 x int]}* %X, int 0, uint 1, int 0
+ %X.2 = load int* %X.2p
+ %X.1p = getelementptr {int,[2 x int]}* %X, int 0, uint 0
+ store int %X.2, int* %X.1p
+ store int 42, int* %X.2p
+ ret void
+}
+
bool %accessor() {
%V = load bool* %CTORGV ;; constant true
ret bool %V
More information about the llvm-commits
mailing list