1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
2 ; RUN: opt < %s -passes=argpromotion,mem2reg -S | FileCheck %s
3 target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
5 define internal i32 @test(ptr %X, ptr %Y) {
6 ; CHECK-LABEL: define {{[^@]+}}@test
7 ; CHECK-SAME: (i32 [[X_0_VAL:%.*]], i32 [[Y_0_VAL:%.*]]) {
8 ; CHECK-NEXT: [[C:%.*]] = add i32 [[X_0_VAL]], [[Y_0_VAL]]
9 ; CHECK-NEXT: ret i32 [[C]]
17 define internal i32 @caller(ptr %B) {
18 ; CHECK-LABEL: define {{[^@]+}}@caller
19 ; CHECK-SAME: (i32 [[B_0_VAL:%.*]]) {
20 ; CHECK-NEXT: [[C:%.*]] = call i32 @test(i32 1, i32 [[B_0_VAL]])
21 ; CHECK-NEXT: ret i32 [[C]]
25 %C = call i32 @test(ptr %A, ptr %B)
29 define i32 @callercaller() {
30 ; CHECK-LABEL: define {{[^@]+}}@callercaller() {
31 ; CHECK-NEXT: [[X:%.*]] = call i32 @caller(i32 2)
32 ; CHECK-NEXT: ret i32 [[X]]
36 %X = call i32 @caller(ptr %B)