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, ptr %P) {
6 ; CHECK-LABEL: define {{[^@]+}}@callee
7 ; CHECK-SAME: (i1 [[C:%.*]], ptr [[P:%.*]]) {
9 ; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
11 ; CHECK-NEXT: ret i32 17
13 ; CHECK-NEXT: [[X:%.*]] = load i32, ptr [[P]], align 4
14 ; CHECK-NEXT: ret i32 [[X]]
17 br i1 %C, label %T, label %F
28 ; CHECK-LABEL: define {{[^@]+}}@foo() {
30 ; CHECK-NEXT: [[X:%.*]] = call i32 @callee(i1 true, ptr null)
31 ; CHECK-NEXT: ret i32 [[X]]
34 %X = call i32 @callee(i1 true, ptr null)