blob: 276ca64d7869be84fe854afed5a918ec562e7f02 [file] [log] [blame]
Dan Gohman3e054fe2009-09-08 22:34:10 +00001; RUN: opt < %s -globalopt -S | not grep global
Chris Lattnerbb99fc42004-10-08 17:29:47 +00002
Tanya Lattnerec9a35a2008-03-01 09:15:35 +00003@G = internal global { i32, float, { double } } {
4 i32 1,
5 float 1.000000e+00,
6 { double } { double 1.727000e+01 } } ; <{ i32, float, { double } }*> [#uses=3]
Chris Lattnerbb99fc42004-10-08 17:29:47 +00007
Tanya Lattnerec9a35a2008-03-01 09:15:35 +00008define void @onlystore() {
9 store i32 123, i32* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 0)
10 ret void
Chris Lattnerbb99fc42004-10-08 17:29:47 +000011}
12
Tanya Lattnerec9a35a2008-03-01 09:15:35 +000013define float @storeinit() {
14 store float 1.000000e+00, float* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 1)
15 %X = load float* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 1) ; <float> [#uses=1]
16 ret float %X
Chris Lattnerbb99fc42004-10-08 17:29:47 +000017}
18
Tanya Lattnerec9a35a2008-03-01 09:15:35 +000019define double @constantize() {
20 %X = load double* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 2, i32 0) ; <double> [#uses=1]
21 ret double %X
Chris Lattnerbb99fc42004-10-08 17:29:47 +000022}
Tanya Lattnerec9a35a2008-03-01 09:15:35 +000023