blob: 43df00c6940663f26ed71392aa23b9da94a9eb4e [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade < %s | llvm-as | opt -sccp -adce -simplifycfg | llvm-dis | \
2; RUN: not grep br
3
4; No matter how hard you try, sqrt(1.0) is always 1.0. This allows the
5; optimizer to delete this loop.
6
7declare double %sqrt(double)
8
9double %test(uint %param) {
10entry:
11 br label %Loop
12
13Loop:
14 %I2 = phi uint [ 0, %entry ], [ %I3, %Loop ]
15 %V = phi double [ 1.0, %entry], [ %V2, %Loop ]
16
17 %V2 = call double %sqrt(double %V)
18
19 %I3 = add uint %I2, 1
20 %tmp.7 = setne uint %I3, %param
21 br bool %tmp.7, label %Loop, label %Exit
22
23Exit:
24 ret double %V
25}