xref: /llvm-project/llvm/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll (revision d586bd5ca231a6022f439d4c6e43cfeeb53eb1d6)
10676acb6SBjorn Pettersson; RUN: opt < %s -passes=globalopt
2cee313d2SEric Christopher
3*d586bd5cSNikita Popov@V = global float 1.200000e+01          ; <ptr> [#uses=1]
4*d586bd5cSNikita Popov@G = internal global ptr null          ; <ptr> [#uses=2]
5cee313d2SEric Christopher
6cee313d2SEric Christopherdefine i32 @user() {
7*d586bd5cSNikita Popov        %P = load ptr, ptr @G              ; <ptr> [#uses=1]
8*d586bd5cSNikita Popov        %Q = load i32, ptr %P               ; <i32> [#uses=1]
9cee313d2SEric Christopher        ret i32 %Q
10cee313d2SEric Christopher}
11cee313d2SEric Christopher
12cee313d2SEric Christopherdefine void @setter() {
13*d586bd5cSNikita Popov        store ptr @V, ptr @G
14cee313d2SEric Christopher        ret void
15cee313d2SEric Christopher}
16cee313d2SEric Christopher
17