1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
2 ; RUN: opt < %s -basic-aa -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(i32* %X, i32* %Y) {
6 ; CHECK-LABEL: define {{[^@]+}}@test
7 ; CHECK-SAME: (i32 [[X_VAL:%.*]], i32 [[Y_VAL:%.*]])
8 ; CHECK-NEXT: [[C:%.*]] = add i32 [[X_VAL]], [[Y_VAL]]
9 ; CHECK-NEXT: ret i32 [[C]]
11 %A = load i32, i32* %X
12 %B = load i32, i32* %Y
17 define internal i32 @caller(i32* %B) {
18 ; CHECK-LABEL: define {{[^@]+}}@caller
19 ; CHECK-SAME: (i32 [[B_VAL1:%.*]])
20 ; CHECK-NEXT: [[C:%.*]] = call i32 @test(i32 1, i32 [[B_VAL1]])
21 ; CHECK-NEXT: ret i32 [[C]]
25 %C = call i32 @test(i32* %A, i32* %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(i32* %B)