1 ; This is a basic sanity check for constant propagation. The fneg instruction
2 ; should be eliminated.
4 ; RUN: opt < %s -sccp -S | FileCheck %s
6 define double @test(i1 %B) {
7 br i1 %B, label %BB1, label %BB2
9 %Val = fneg double 42.0
14 %Ret = phi double [%Val, %BB1], [1.0, %BB2]
17 ; CHECK: [[PHI:%.*]] = phi double [ -4.200000e+01, %BB1 ], [ 1.000000e+00, %BB2 ]
20 define double @test1(i1 %B) {
21 br i1 %B, label %BB1, label %BB2
23 %Div = fdiv double 1.0, 1.0
24 %Val = fneg double %Div
29 %Ret = phi double [%Val, %BB1], [1.0, %BB2]
31 ; CHECK-LABEL: @test1(
32 ; CHECK: [[PHI:%.*]] = phi double [ -1.000000e+00, %BB1 ], [ 1.000000e+00, %BB2 ]