1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
2 ; RUN: opt < %s -passes=argpromotion -S | FileCheck %s
4 ; Don't promote around control flow.
5 define internal i32 @callee(i1 %C, i32* %P) {
6 ; CHECK-LABEL: define {{[^@]+}}@callee
7 ; CHECK-SAME: (i1 [[C:%.*]], i32* [[P:%.*]])
9 ; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
11 ; CHECK-NEXT: ret i32 17
13 ; CHECK-NEXT: [[X:%.*]] = load i32, i32* [[P]]
14 ; CHECK-NEXT: ret i32 [[X]]
17 br i1 %C, label %T, label %F
23 %X = load i32, i32* %P
28 ; CHECK-LABEL: define {{[^@]+}}@foo()
30 ; CHECK-NEXT: [[X:%.*]] = call i32 @callee(i1 true, i32* null)
31 ; CHECK-NEXT: ret i32 [[X]]
34 %X = call i32 @callee(i1 true, i32* null)