• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -ipsccp -S | FileCheck %s
3
4; See PR26774
5
6define i32 @baz() {
7; CHECK-LABEL: @baz(
8; CHECK-NEXT:    ret i32 10
9;
10  ret i32 10
11}
12
13; We can const-prop @baz's return value *into* @foo, but cannot
14; 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 10
20;
21
22  %val = call i32 @baz()
23  ret i32 %val
24}
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 %val
34}
35