brintos

brintos / llvm-project-archived public Read only

0
0
Text · 674 B · 6f2ace6 Raw
35 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -passes=ipsccp -S | FileCheck %s3 4; See PR267745 6define i32 @baz() {7; CHECK-LABEL: @baz(8; CHECK-NEXT:    ret i32 109;10  ret i32 1011}12 13; We can const-prop @baz's return value *into* @foo, but cannot14; constprop @foo's return value into bar.15 16define linkonce_odr i32 @foo() {17; CHECK-LABEL: @foo(18; CHECK-NEXT:    [[VAL:%.*]] = call i32 @baz()19; CHECK-NEXT:    ret i32 1020;21 22  %val = call i32 @baz()23  ret i32 %val24}25 26define i32 @bar() {27; CHECK-LABEL: @bar(28; CHECK-NEXT:    [[VAL:%.*]] = call i32 @foo()29; CHECK-NEXT:    ret i32 [[VAL]]30;31 32  %val = call i32 @foo()33  ret i32 %val34}35