1 ; RUN: opt < %s -argpromotion -S | FileCheck %s
2 ; RUN: opt < %s -passes=argpromotion -S | FileCheck %s
4 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-pc-windows-msvc"
7 ; CHECK: define internal void @add(i32 %[[THIS1:.*]], i32 %[[THIS2:.*]], i32* noalias %[[SR:.*]])
8 define internal void @add({i32, i32}* %this, i32* sret %r) {
9 %ap = getelementptr {i32, i32}, {i32, i32}* %this, i32 0, i32 0
10 %bp = getelementptr {i32, i32}, {i32, i32}* %this, i32 0, i32 1
11 %a = load i32, i32* %ap
12 %b = load i32, i32* %bp
13 ; CHECK: %[[AB:.*]] = add i32 %[[THIS1]], %[[THIS2]]
15 ; CHECK: store i32 %[[AB]], i32* %[[SR]]
16 store i32 %ab, i32* %r
20 ; CHECK: define void @f()
22 ; CHECK: %[[R:.*]] = alloca i32
24 %pair = alloca {i32, i32}
26 ; CHECK: call void @add(i32 %{{.*}}, i32 %{{.*}}, i32* noalias %[[R]])
27 call void @add({i32, i32}* %pair, i32* sret %r)