Home | History | Annotate | Download | only in SCCP
      1 ; RUN: opt < %s -ipsccp -S | FileCheck %s
      2 
      3 ; See PR26774
      4 
      5 define i32 @baz() {
      6   ret i32 10
      7 }
      8 
      9 ; We can const-prop @baz's return value *into* @foo, but cannot
     10 ; constprop @foo's return value into bar.
     11 
     12 define linkonce_odr i32 @foo() {
     13 ; CHECK-LABEL: @foo(
     14 ; CHECK-NEXT:  %val = call i32 @baz()
     15 ; CHECK-NEXT:  ret i32 10
     16 
     17   %val = call i32 @baz()
     18   ret i32 %val
     19 }
     20 
     21 define i32 @bar() {
     22 ; CHECK-LABEL: @bar(
     23 ; CHECK-NEXT:  %val = call i32 @foo()
     24 ; CHECK-NEXT:  ret i32 %val
     25 
     26   %val = call i32 @foo()
     27   ret i32 %val
     28 }
     29