blob: e521cc1350fbe896b397d387e5690e9ee4a95440 [file] [log] [blame]
Duncan Sands9929be92007-11-23 19:30:27 +00001; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse | llvm-dis | not grep load
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002
Duncan Sands9929be92007-11-23 19:30:27 +00003; This test requires the use of previous analyses to determine that
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004; doesnotmodX does not modify X (because 'sin' doesn't).
5
Duncan Sands9929be92007-11-23 19:30:27 +00006@X = internal global i32 4 ; <i32*> [#uses=2]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007
Duncan Sands9929be92007-11-23 19:30:27 +00008declare double @sin(double) readnone
Dan Gohmanf17a25c2007-07-18 16:29:46 +00009
Duncan Sands9929be92007-11-23 19:30:27 +000010define i32 @test(i32* %P) {
11 store i32 12, i32* @X
12 call double @doesnotmodX( double 1.000000e+00 ) ; <double>:1 [#uses=0]
13 %V = load i32* @X ; <i32> [#uses=1]
14 ret i32 %V
Dan Gohmanf17a25c2007-07-18 16:29:46 +000015}
16
Duncan Sands9929be92007-11-23 19:30:27 +000017define double @doesnotmodX(double %V) {
18 %V2 = call double @sin( double %V ) readnone ; <double> [#uses=1]
19 ret double %V2
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020}