blob: bdcf1fa4778bab2887046797099ff06677f87aa6 [file] [log] [blame]
Dan Gohman18800922009-09-11 18:01:28 +00001; RUN: opt < %s -globalopt
Chris Lattner89e0b392004-10-10 17:06:09 +00002
Tanya Lattner5640bd12008-03-01 09:15:35 +00003@V = global float 1.200000e+01 ; <float*> [#uses=1]
4@G = internal global i32* null ; <i32**> [#uses=2]
Chris Lattner89e0b392004-10-10 17:06:09 +00005
Tanya Lattner5640bd12008-03-01 09:15:35 +00006define i32 @user() {
7 %P = load i32** @G ; <i32*> [#uses=1]
8 %Q = load i32* %P ; <i32> [#uses=1]
9 ret i32 %Q
Chris Lattner89e0b392004-10-10 17:06:09 +000010}
11
Tanya Lattner5640bd12008-03-01 09:15:35 +000012define void @setter() {
13 %Vi = bitcast float* @V to i32* ; <i32*> [#uses=1]
14 store i32* %Vi, i32** @G
15 ret void
Chris Lattner89e0b392004-10-10 17:06:09 +000016}
17