12 changes: 6 additions & 6 deletions clang/test/CodeGenCXX/temporaries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,13 @@ namespace Elision {
// CHECK-NEXT: call void @_ZN7Elision1AC1Ev([[A]]* [[I]])
A i = (foo(), A());

// CHECK-NEXT: call void @_ZN7Elision4fooAEv([[A]]* sret [[T0]])
// CHECK-NEXT: call void @_ZN7Elision4fooAEv([[A]]* sret align 8 [[T0]])
// CHECK-NEXT: call void @_ZN7Elision1AC1Ev([[A]]* [[J]])
// CHECK-NEXT: call void @_ZN7Elision1AD1Ev([[A]]* [[T0]])
A j = (fooA(), A());

// CHECK-NEXT: call void @_ZN7Elision1AC1Ev([[A]]* [[T1]])
// CHECK-NEXT: call void @_ZN7Elision4fooAEv([[A]]* sret [[K]])
// CHECK-NEXT: call void @_ZN7Elision4fooAEv([[A]]* sret align 8 [[K]])
// CHECK-NEXT: call void @_ZN7Elision1AD1Ev([[A]]* [[T1]])
A k = (A(), fooA());

Expand All @@ -436,15 +436,15 @@ namespace Elision {
// CHECK-NEXT: call void @_ZN7Elision1AD1Ev([[A]]* [[I]])
}

// CHECK: define void @_ZN7Elision5test2Ev([[A]]* noalias sret
// CHECK: define void @_ZN7Elision5test2Ev([[A]]* noalias sret align 8
A test2() {
// CHECK: call void @_ZN7Elision3fooEv()
// CHECK-NEXT: call void @_ZN7Elision1AC1Ev([[A]]* [[RET:%.*]])
// CHECK-NEXT: ret void
return (foo(), A());
}

// CHECK: define void @_ZN7Elision5test3EiNS_1AE([[A]]* noalias sret
// CHECK: define void @_ZN7Elision5test3EiNS_1AE([[A]]* noalias sret align 8
A test3(int v, A x) {
if (v < 5)
// CHECK: call void @_ZN7Elision1AC1Ev([[A]]* [[RET:%.*]])
Expand Down Expand Up @@ -485,7 +485,7 @@ namespace Elision {
}

// rdar://problem/8433352
// CHECK: define void @_ZN7Elision5test5Ev([[A]]* noalias sret
// CHECK: define void @_ZN7Elision5test5Ev([[A]]* noalias sret align 8
struct B { A a; B(); };
A test5() {
// CHECK: [[AT0:%.*]] = alloca [[A]], align 8
Expand Down Expand Up @@ -523,7 +523,7 @@ namespace Elision {
void test6(const C *x) {
// CHECK: [[T0:%.*]] = alloca [[A]], align 8
// CHECK: [[X:%.*]] = load [[C]]*, [[C]]** {{%.*}}, align 8
// CHECK-NEXT: call void @_ZNK7Elision1CcvNS_1AEEv([[A]]* sret [[T0]], [[C]]* [[X]])
// CHECK-NEXT: call void @_ZNK7Elision1CcvNS_1AEEv([[A]]* sret align 8 [[T0]], [[C]]* [[X]])
// CHECK-NEXT: call void @_ZNK7Elision1A3fooEv([[A]]* [[T0]])
// CHECK-NEXT: call void @_ZN7Elision1AD1Ev([[A]]* [[T0]])
// CHECK-NEXT: ret void
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGenCXX/thiscall-struct-return.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ void test( void ) {
// CHECK: call void @_ZN1CC1Ev(%class.C* [[C:%.+]])
C c;

// CHECK: call x86_thiscallcc void @_ZNK1C5SmallEv(%struct.S* sret %{{.+}}, %class.C* [[C]])
// CHECK: call x86_thiscallcc void @_ZNK1C5SmallEv(%struct.S* sret align 4 %{{.+}}, %class.C* [[C]])
(void)c.Small();
// CHECK: call x86_thiscallcc void @_ZNK1C6MediumEv(%struct.M* sret %{{.+}}, %class.C* [[C]])
// CHECK: call x86_thiscallcc void @_ZNK1C6MediumEv(%struct.M* sret align 4 %{{.+}}, %class.C* [[C]])
(void)c.Medium();
}
4 changes: 2 additions & 2 deletions clang/test/CodeGenCXX/thunk-returning-memptr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ C::C() {}
// Because of the tail call, the return value cannot be copied into a local
// alloca. (PR39901)

// CHECK-LABEL: define linkonce_odr void @_ZThn4_N1C1fEv({ i32, i32 }* noalias sret %agg.result, %struct.C* %this)
// CHECK: tail call void @_ZN1C1fEv({ i32, i32 }* sret %agg.result
// CHECK-LABEL: define linkonce_odr void @_ZThn4_N1C1fEv({ i32, i32 }* noalias sret align 4 %agg.result, %struct.C* %this)
// CHECK: tail call void @_ZN1C1fEv({ i32, i32 }* sret align 4 %agg.result
6 changes: 3 additions & 3 deletions clang/test/CodeGenCXX/thunks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ namespace Test6 {
// CHECK-LABEL: define void @_ZThn16_N5Test66Thunks1fEv
// CHECK-DBG-NOT: dbg.declare
// CHECK-NOT: memcpy
// CHECK: {{call void @_ZN5Test66Thunks1fEv.*sret}}
// CHECK: {{call void @_ZN5Test66Thunks1fEv.*sret align 1}}
// CHECK: ret void
X Thunks::f() { return X(); }

// WIN64-LABEL: define linkonce_odr dso_local void @"?f@Thunks@Test6@@WBA@EAA?AUX@2@XZ"({{.*}} sret %{{.*}})
// WIN64-LABEL: define linkonce_odr dso_local void @"?f@Thunks@Test6@@WBA@EAA?AUX@2@XZ"({{.*}} sret align 1 %{{.*}})
// WIN64-NOT: memcpy
// WIN64: tail call void @"?f@Thunks@Test6@@UEAA?AUX@2@XZ"({{.*}} sret %{{.*}})
// WIN64: tail call void @"?f@Thunks@Test6@@UEAA?AUX@2@XZ"({{.*}} sret align 1 %{{.*}})
}

namespace Test7 {
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGenCXX/trivial_abi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void testIgnoredSmall() {
void testParamLarge(Large a) noexcept {
}

// CHECK: define void @_Z15testReturnLargev(%[[STRUCT_LARGE:.*]]* noalias sret %[[AGG_RESULT:.*]])
// CHECK: define void @_Z15testReturnLargev(%[[STRUCT_LARGE:.*]]* noalias sret align 8 %[[AGG_RESULT:.*]])
// CHECK: %[[CALL:.*]] = call %[[STRUCT_LARGE]]* @_ZN5LargeC1Ev(%[[STRUCT_LARGE]]* %[[AGG_RESULT]])
// CHECK: ret void
// CHECK: }
Expand All @@ -153,7 +153,7 @@ void testCallLarge0() {

// CHECK: define void @_Z14testCallLarge1v()
// CHECK: %[[AGG_TMP:.*]] = alloca %[[STRUCT_LARGE:.*]], align 8
// CHECK: call void @_Z15testReturnLargev(%[[STRUCT_LARGE]]* sret %[[AGG_TMP]])
// CHECK: call void @_Z15testReturnLargev(%[[STRUCT_LARGE]]* sret align 8 %[[AGG_TMP]])
// CHECK: call void @_Z14testParamLarge5Large(%[[STRUCT_LARGE]]* %[[AGG_TMP]])
// CHECK: ret void
// CHECK: }
Expand All @@ -164,7 +164,7 @@ void testCallLarge1() {

// CHECK: define void @_Z16testIgnoredLargev()
// CHECK: %[[AGG_TMP_ENSURED:.*]] = alloca %[[STRUCT_LARGE:.*]], align 8
// CHECK: call void @_Z15testReturnLargev(%[[STRUCT_LARGE]]* sret %[[AGG_TMP_ENSURED]])
// CHECK: call void @_Z15testReturnLargev(%[[STRUCT_LARGE]]* sret align 8 %[[AGG_TMP_ENSURED]])
// CHECK: %[[CALL:.*]] = call %[[STRUCT_LARGE]]* @_ZN5LargeD1Ev(%[[STRUCT_LARGE]]* %[[AGG_TMP_ENSURED]])
// CHECK: ret void
// CHECK: }
Expand All @@ -186,7 +186,7 @@ Trivial testReturnHasTrivial() {
return t;
}

// CHECK: define void @_Z23testReturnHasNonTrivialv(%[[STRUCT_NONTRIVIAL:.*]]* noalias sret %[[AGG_RESULT:.*]])
// CHECK: define void @_Z23testReturnHasNonTrivialv(%[[STRUCT_NONTRIVIAL:.*]]* noalias sret align 4 %[[AGG_RESULT:.*]])
// CHECK: %[[CALL:.*]] = call %[[STRUCT_NONTRIVIAL]]* @_ZN10NonTrivialC1Ev(%[[STRUCT_NONTRIVIAL]]* %[[AGG_RESULT]])
// CHECK: ret void
// CHECK: }
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenCXX/unknown-anytype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct Test7 {
};
extern "C" __unknown_anytype test7_any(int);
Test7 test7() {
// COMMON: call void @test7_any({{%.*}}* sret {{%.*}}, i32 5)
// COMMON: call void @test7_any({{%.*}}* sret align 1 {{%.*}}, i32 5)
return (Test7) test7_any(5);
}

Expand Down
18 changes: 9 additions & 9 deletions clang/test/CodeGenCXX/wasm-args-returns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,52 +30,52 @@ struct two_fields {
double d, e;
};
test(two_fields);
// CHECK: define void @_Z7forward10two_fields(%struct.two_fields* noalias nocapture sret %{{.*}}, %struct.two_fields* nocapture readonly byval(%struct.two_fields) align 8 %{{.*}})
// CHECK: define void @_Z7forward10two_fields(%struct.two_fields* noalias nocapture sret align 8 %{{.*}}, %struct.two_fields* nocapture readonly byval(%struct.two_fields) align 8 %{{.*}})
//
// CHECK: define void @_Z15test_two_fieldsv()
// CHECK: %[[tmp:.*]] = alloca %struct.two_fields, align 8
// CHECK: call void @_Z14def_two_fieldsv(%struct.two_fields* nonnull sret %[[tmp]])
// CHECK: call void @_Z14def_two_fieldsv(%struct.two_fields* nonnull sret align 8 %[[tmp]])
// CHECK: call void @_Z3use10two_fields(%struct.two_fields* nonnull byval(%struct.two_fields) align 8 %[[tmp]])
// CHECK: ret void
//
// CHECK: declare void @_Z3use10two_fields(%struct.two_fields* byval(%struct.two_fields) align 8)
// CHECK: declare void @_Z14def_two_fieldsv(%struct.two_fields* sret)
// CHECK: declare void @_Z14def_two_fieldsv(%struct.two_fields* sret align 8)

struct copy_ctor {
double d;
copy_ctor(copy_ctor const &);
};
test(copy_ctor);
// CHECK: define void @_Z7forward9copy_ctor(%struct.copy_ctor* noalias sret %{{.*}}, %struct.copy_ctor* nonnull %{{.*}})
// CHECK: define void @_Z7forward9copy_ctor(%struct.copy_ctor* noalias sret align 8 %{{.*}}, %struct.copy_ctor* nonnull %{{.*}})
//
// CHECK: declare %struct.copy_ctor* @_ZN9copy_ctorC1ERKS_(%struct.copy_ctor* returned, %struct.copy_ctor* dereferenceable(8))
//
// CHECK: define void @_Z14test_copy_ctorv()
// CHECK: %[[tmp:.*]] = alloca %struct.copy_ctor, align 8
// CHECK: call void @_Z13def_copy_ctorv(%struct.copy_ctor* nonnull sret %[[tmp]])
// CHECK: call void @_Z13def_copy_ctorv(%struct.copy_ctor* nonnull sret align 8 %[[tmp]])
// CHECK: call void @_Z3use9copy_ctor(%struct.copy_ctor* nonnull %[[tmp]])
// CHECK: ret void
//
// CHECK: declare void @_Z3use9copy_ctor(%struct.copy_ctor*)
// CHECK: declare void @_Z13def_copy_ctorv(%struct.copy_ctor* sret)
// CHECK: declare void @_Z13def_copy_ctorv(%struct.copy_ctor* sret align 8)

struct __attribute__((aligned(16))) aligned_copy_ctor {
double d, e;
aligned_copy_ctor(aligned_copy_ctor const &);
};
test(aligned_copy_ctor);
// CHECK: define void @_Z7forward17aligned_copy_ctor(%struct.aligned_copy_ctor* noalias sret %{{.*}}, %struct.aligned_copy_ctor* nonnull %{{.*}})
// CHECK: define void @_Z7forward17aligned_copy_ctor(%struct.aligned_copy_ctor* noalias sret align 16 %{{.*}}, %struct.aligned_copy_ctor* nonnull %{{.*}})
//
// CHECK: declare %struct.aligned_copy_ctor* @_ZN17aligned_copy_ctorC1ERKS_(%struct.aligned_copy_ctor* returned, %struct.aligned_copy_ctor* dereferenceable(16))
//
// CHECK: define void @_Z22test_aligned_copy_ctorv()
// CHECK: %[[tmp:.*]] = alloca %struct.aligned_copy_ctor, align 16
// CHECK: call void @_Z21def_aligned_copy_ctorv(%struct.aligned_copy_ctor* nonnull sret %[[tmp]])
// CHECK: call void @_Z21def_aligned_copy_ctorv(%struct.aligned_copy_ctor* nonnull sret align 16 %[[tmp]])
// CHECK: call void @_Z3use17aligned_copy_ctor(%struct.aligned_copy_ctor* nonnull %[[tmp]])
// CHECK: ret void
//
// CHECK: declare void @_Z3use17aligned_copy_ctor(%struct.aligned_copy_ctor*)
// CHECK: declare void @_Z21def_aligned_copy_ctorv(%struct.aligned_copy_ctor* sret)
// CHECK: declare void @_Z21def_aligned_copy_ctorv(%struct.aligned_copy_ctor* sret align 16)

struct empty {};
test(empty);
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGenCXX/x86_32-arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct S {
short s;
};

// CHECK-LABEL: define void @_Z1fv(%struct.S* noalias sret %
// CHECK-LABEL: define void @_Z1fv(%struct.S* noalias sret align 2 %
S f() { return S(); }
// CHECK-LABEL: define void @_Z1f1S(%struct.S* %0)
void f(S) { }
Expand All @@ -18,7 +18,7 @@ class C {
double c;
};

// CHECK-LABEL: define void @_Z1gv(%class.C* noalias sret %
// CHECK-LABEL: define void @_Z1gv(%class.C* noalias sret align 4 %
C g() { return C(); }

// CHECK-LABEL: define void @_Z1f1C(%class.C* %0)
Expand Down Expand Up @@ -103,13 +103,13 @@ struct s7_1 { double x; };
struct s7 : s7_0, s7_1 { };
s7 f7() { return s7(); }

// CHECK-LABEL: define void @_Z2f8v(%struct.s8* noalias sret %agg.result)
// CHECK-LABEL: define void @_Z2f8v(%struct.s8* noalias sret align 4 %agg.result)
struct s8_0 { };
struct s8_1 { double x; };
struct s8 { s8_0 a; s8_1 b; };
s8 f8() { return s8(); }

// CHECK-LABEL: define void @_Z2f9v(%struct.s9* noalias sret %agg.result)
// CHECK-LABEL: define void @_Z2f9v(%struct.s9* noalias sret align 4 %agg.result)
struct s9_0 { unsigned : 0; };
struct s9_1 { double x; };
struct s9 { s9_0 a; s9_1 b; };
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGenCXX/x86_64-arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ namespace test9 {
// CHECK: define void @_ZN5test93fooEPNS_1SEPNS_1TE([[S:%.*]]* %0, [[T:%.*]]* %1)
void foo(S*, T*) {}

// CHECK: define void @_ZN5test91aEiiiiNS_1TEPv([[S]]* noalias sret {{%.*}}, i32 %0, i32 %1, i32 %2, i32 %3, [[T]]* byval([[T]]) align 8 %4, i8* %5)
// CHECK: define void @_ZN5test91aEiiiiNS_1TEPv([[S]]* noalias sret align 8 {{%.*}}, i32 %0, i32 %1, i32 %2, i32 %3, [[T]]* byval([[T]]) align 8 %4, i8* %5)
S a(int, int, int, int, T, void*) {
return S();
}
Expand All @@ -186,7 +186,7 @@ namespace test9 {
return sret;
}

// CHECK: define void @_ZN5test91cEiiiNS_1TEPv([[S]]* noalias sret {{%.*}}, i32 %0, i32 %1, i32 %2, i8* {{%.*}}, i8* {{%.*}}, i8* %3)
// CHECK: define void @_ZN5test91cEiiiNS_1TEPv([[S]]* noalias sret align 8 {{%.*}}, i32 %0, i32 %1, i32 %2, i8* {{%.*}}, i8* {{%.*}}, i8* %3)
S c(int, int, int, T, void*) {
return S();
}
Expand Down
10 changes: 5 additions & 5 deletions clang/test/CodeGenCoroutines/coro-await.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ extern "C" void f1(int) {
// CHECK: %[[PROMISE:.+]] = alloca %"struct.std::experimental::coroutine_traits<void, int>::promise_type"
// CHECK: %[[FRAME:.+]] = call i8* @llvm.coro.begin(
co_yield 42;
// CHECK: call void @_ZNSt12experimental16coroutine_traitsIJviEE12promise_type11yield_valueEi(%struct.suspend_maybe* sret %[[AWAITER:.+]], %"struct.std::experimental::coroutine_traits<void, int>::promise_type"* %[[PROMISE]], i32 42)
// CHECK: call void @_ZNSt12experimental16coroutine_traitsIJviEE12promise_type11yield_valueEi(%struct.suspend_maybe* sret align 4 %[[AWAITER:.+]], %"struct.std::experimental::coroutine_traits<void, int>::promise_type"* %[[PROMISE]], i32 42)

// See if we need to suspend:
// --------------------------
Expand Down Expand Up @@ -197,20 +197,20 @@ extern "C" void UseAggr(Aggr&&);
extern "C" void TestAggr() {
UseAggr(co_await AggrAwaiter{});
Whatever();
// CHECK: call void @_ZN11AggrAwaiter12await_resumeEv(%struct.Aggr* sret %[[AwaitResume:.+]],
// CHECK: call void @_ZN11AggrAwaiter12await_resumeEv(%struct.Aggr* sret align 4 %[[AwaitResume:.+]],
// CHECK: call void @UseAggr(%struct.Aggr* dereferenceable(12) %[[AwaitResume]])
// CHECK: call void @_ZN4AggrD1Ev(%struct.Aggr* %[[AwaitResume]])
// CHECK: call void @Whatever()

co_await AggrAwaiter{};
Whatever();
// CHECK: call void @_ZN11AggrAwaiter12await_resumeEv(%struct.Aggr* sret %[[AwaitResume2:.+]],
// CHECK: call void @_ZN11AggrAwaiter12await_resumeEv(%struct.Aggr* sret align 4 %[[AwaitResume2:.+]],
// CHECK: call void @_ZN4AggrD1Ev(%struct.Aggr* %[[AwaitResume2]])
// CHECK: call void @Whatever()

Aggr Val = co_await AggrAwaiter{};
Whatever();
// CHECK: call void @_ZN11AggrAwaiter12await_resumeEv(%struct.Aggr* sret %[[AwaitResume3:.+]],
// CHECK: call void @_ZN11AggrAwaiter12await_resumeEv(%struct.Aggr* sret align 4 %[[AwaitResume3:.+]],
// CHECK: call void @Whatever()
// CHECK: call void @_ZN4AggrD1Ev(%struct.Aggr* %[[AwaitResume3]])
}
Expand Down Expand Up @@ -253,7 +253,7 @@ extern "C" void TestOpAwait() {

co_await MyAgg{};
// CHECK: call void @_ZN5MyAggawEv(%struct.MyAgg* %
// CHECK: call void @_ZN11AggrAwaiter12await_resumeEv(%struct.Aggr* sret %
// CHECK: call void @_ZN11AggrAwaiter12await_resumeEv(%struct.Aggr* sret align 4 %
}

// CHECK-LABEL: EndlessLoop(
Expand Down
10 changes: 5 additions & 5 deletions clang/test/CodeGenCoroutines/coro-gro-nrvo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ struct coro {
};

// Verify that the NRVO is applied to the Gro object.
// CHECK-LABEL: define void @_Z1fi(%struct.coro* noalias sret %agg.result, i32 %0)
// CHECK-LABEL: define void @_Z1fi(%struct.coro* noalias sret align 8 %agg.result, i32 %0)
coro f(int) {
// CHECK: %call = call noalias nonnull i8* @_Znwm(
// CHECK-NEXT: br label %[[CoroInit:.*]]

// CHECK: {{.*}}[[CoroInit]]:
// CHECK: store i1 false, i1* %gro.active
// CHECK: call void @{{.*get_return_objectEv}}(%struct.coro* sret %agg.result
// CHECK: call void @{{.*get_return_objectEv}}(%struct.coro* sret align 8 %agg.result
// CHECK-NEXT: store i1 true, i1* %gro.active
co_return;
}
Expand All @@ -65,20 +65,20 @@ struct coro_two {
};

// Verify that the NRVO is applied to the Gro object.
// CHECK-LABEL: define void @_Z1hi(%struct.coro_two* noalias sret %agg.result, i32 %0)
// CHECK-LABEL: define void @_Z1hi(%struct.coro_two* noalias sret align 8 %agg.result, i32 %0)
coro_two h(int) {

// CHECK: %call = call noalias i8* @_ZnwmRKSt9nothrow_t
// CHECK-NEXT: %[[CheckNull:.*]] = icmp ne i8* %call, null
// CHECK-NEXT: br i1 %[[CheckNull]], label %[[InitOnSuccess:.*]], label %[[InitOnFailure:.*]]

// CHECK: {{.*}}[[InitOnFailure]]:
// CHECK-NEXT: call void @{{.*get_return_object_on_allocation_failureEv}}(%struct.coro_two* sret %agg.result
// CHECK-NEXT: call void @{{.*get_return_object_on_allocation_failureEv}}(%struct.coro_two* sret align 8 %agg.result
// CHECK-NEXT: br label %[[RetLabel:.*]]

// CHECK: {{.*}}[[InitOnSuccess]]:
// CHECK: store i1 false, i1* %gro.active
// CHECK: call void @{{.*get_return_objectEv}}(%struct.coro_two* sret %agg.result
// CHECK: call void @{{.*get_return_objectEv}}(%struct.coro_two* sret align 8 %agg.result
// CHECK-NEXT: store i1 true, i1* %gro.active

// CHECK: [[RetLabel]]:
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGenObjC/arc.m
Original file line number Diff line number Diff line change
Expand Up @@ -1538,14 +1538,14 @@ void test70(id i) {
void test71(void) {
// CHECK: %[[T:[^ ]+]] = bitcast %struct.AggDtor* %[[TMP1:[^ ]+]] to i8*
// CHECK: call void @llvm.lifetime.start.p0i8({{[^,]+}}, i8* %[[T]])
// CHECK: call void @getAggDtor(%struct.AggDtor* sret %[[TMP1]])
// CHECK: call void @getAggDtor(%struct.AggDtor* sret align 8 %[[TMP1]])
// CHECK: %[[T:[^ ]+]] = bitcast %struct.AggDtor* %[[TMP1]] to i8**
// CHECK: call void @__destructor_8_s40(i8** %[[T]])
// CHECK: %[[T:[^ ]+]] = bitcast %struct.AggDtor* %[[TMP1:[^ ]+]] to i8*
// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* %[[T]])
// CHECK: %[[T:[^ ]+]] = bitcast %struct.AggDtor* %[[TMP2:[^ ]+]] to i8*
// CHECK: call void @llvm.lifetime.start.p0i8({{[^,]+}}, i8* %[[T]])
// CHECK: call void @getAggDtor(%struct.AggDtor* sret %[[TMP2]])
// CHECK: call void @getAggDtor(%struct.AggDtor* sret align 8 %[[TMP2]])
// CHECK: %[[T:[^ ]+]] = bitcast %struct.AggDtor* %[[TMP2]] to i8**
// CHECK: call void @__destructor_8_s40(i8** %[[T]])
// CHECK: %[[T:[^ ]+]] = bitcast %struct.AggDtor* %[[TMP2:[^ ]+]] to i8*
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenObjC/direct-method.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ + (struct my_complex_struct)classGetComplex __attribute__((objc_direct)) {

// CHECK-LABEL: define hidden void @"\01-[Root getAggregate]"(
- (struct my_aggregate_struct)getAggregate __attribute__((objc_direct)) {
// CHECK: %struct.my_aggregate_struct* noalias sret [[RETVAL:%[^,]*]],
// CHECK: %struct.my_aggregate_struct* noalias sret align 4 [[RETVAL:%[^,]*]],

// loading parameters
// CHECK-LABEL: entry:
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGenObjC/nontrivial-c-struct-exception.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ void testStrongException(void) {
// CHECK: define void @testWeakException()
// CHECK: %[[AGG_TMP:.*]] = alloca %[[STRUCT_WEAK]], align 8
// CHECK: %[[AGG_TMP1:.*]] = alloca %[[STRUCT_WEAK]], align 8
// CHECK: call void @genWeak(%[[STRUCT_WEAK]]* sret %[[AGG_TMP]])
// CHECK: invoke void @genWeak(%[[STRUCT_WEAK]]* sret %[[AGG_TMP1]])
// CHECK: call void @genWeak(%[[STRUCT_WEAK]]* sret align 8 %[[AGG_TMP]])
// CHECK: invoke void @genWeak(%[[STRUCT_WEAK]]* sret align 8 %[[AGG_TMP1]])

// CHECK: call void @calleeWeak(%[[STRUCT_WEAK]]* %[[AGG_TMP]], %[[STRUCT_WEAK]]* %[[AGG_TMP1]])
// CHECK: ret void
Expand Down
6 changes: 3 additions & 3 deletions clang/test/CodeGenObjC/objc-non-trivial-struct-nrvo.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Trivial testTrivial(void) {

void func1(TrivialBig *);

// CHECK: define void @testTrivialBig(%[[STRUCT_TRIVIALBIG]]* noalias sret %[[AGG_RESULT:.*]])
// CHECK: define void @testTrivialBig(%[[STRUCT_TRIVIALBIG]]* noalias sret align 4 %[[AGG_RESULT:.*]])
// CHECK: call void @func1(%[[STRUCT_TRIVIALBIG]]* %[[AGG_RESULT]])
// CHECK-NEXT: ret void

Expand Down Expand Up @@ -69,7 +69,7 @@ Strong testStrong(void) {
return a;
}

// CHECK: define void @testWeak(%[[STRUCT_WEAK]]* noalias sret %[[AGG_RESULT:.*]])
// CHECK: define void @testWeak(%[[STRUCT_WEAK]]* noalias sret align 8 %[[AGG_RESULT:.*]])
// CHECK: %[[NRVO:.*]] = alloca i1, align 1
// CHECK: %[[V0:.*]] = bitcast %[[STRUCT_WEAK]]* %[[AGG_RESULT]] to i8**
// CHECK: call void @__default_constructor_8_w0(i8** %[[V0]])
Expand Down Expand Up @@ -105,7 +105,7 @@ Weak testWeak2(int c) {
return b;
}

// CHECK: define internal void @"\01-[C1 foo1]"(%[[STRUCT_WEAK]]* noalias sret %[[AGG_RESULT:.*]], %{{.*}}* %{{.*}}, i8* %{{.*}})
// CHECK: define internal void @"\01-[C1 foo1]"(%[[STRUCT_WEAK]]* noalias sret align 8 %[[AGG_RESULT:.*]], %{{.*}}* %{{.*}}, i8* %{{.*}})
// CHECK: %[[NRVO:.*]] = alloca i1, align 1
// CHECK: %[[V0:.*]] = bitcast %[[STRUCT_WEAK]]* %[[AGG_RESULT]] to i8**
// CHECK: call void @__default_constructor_8_w0(i8** %[[V0]])
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGenObjC/stret-1.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ int main(int argc, const char **argv)
{
struct stret s;
s = [(id)(argc&~255) method];
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret [[T0:%[^,]+]]
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret align 4 [[T0:%[^,]+]]
// CHECK: [[T0P:%.*]] = bitcast %struct.stret* [[T0]] to i8*
// CHECK: call void @llvm.memset.p0i8.i64(i8* align 4 [[T0P]], i8 0, i64 400, i1 false)

s = [Test method];
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret [[T1:%[^,]+]]
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret align 4 [[T1:%[^,]+]]
// CHECK-NOT: call void @llvm.memset.p0i8.i64(

[(id)(argc&~255) method];
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret [[T1:%[^,]+]]
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret align 4 [[T1:%[^,]+]]
// CHECK-NOT: call void @llvm.memset.p0i8.i64(

[Test method];
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret [[T1:%[^,]+]]
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret align 4 [[T1:%[^,]+]]
// CHECK-NOT: call void @llvm.memset.p0i8.i64(
}
2 changes: 1 addition & 1 deletion clang/test/CodeGenObjC/weak-in-c-struct.m
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void test_argument_Weak(Weak *a) {
calleeWeak(*a);
}

// COMMON: define void @test_return_Weak(%[[STRUCT_WEAK]]* noalias sret %[[AGG_RESULT:.*]], %[[STRUCT_WEAK]]* %[[A:.*]])
// COMMON: define void @test_return_Weak(%[[STRUCT_WEAK]]* noalias sret align {{.*}} %[[AGG_RESULT:.*]], %[[STRUCT_WEAK]]* %[[A:.*]])
// COMMON: %[[A_ADDR:.*]] = alloca %[[STRUCT_WEAK]]*
// COMMON: store %[[STRUCT_WEAK]]* %[[A]], %[[STRUCT_WEAK]]** %[[A_ADDR]]
// COMMON: %[[V0:.*]] = load %[[STRUCT_WEAK]]*, %[[STRUCT_WEAK]]** %[[A_ADDR]]
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenObjCXX/objc-struct-cxx-abi.mm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void testCallStrongWeak(StrongWeak *a) {
testParamStrongWeak(*a);
}

// CHECK: define void @_Z20testReturnStrongWeakP10StrongWeak(%[[STRUCT_STRONGWEAK:.*]]* noalias sret %[[AGG_RESULT:.*]], %[[STRUCT_STRONGWEAK]]* %[[A:.*]])
// CHECK: define void @_Z20testReturnStrongWeakP10StrongWeak(%[[STRUCT_STRONGWEAK:.*]]* noalias sret align 8 %[[AGG_RESULT:.*]], %[[STRUCT_STRONGWEAK]]* %[[A:.*]])
// CHECK: %[[A_ADDR:.*]] = alloca %[[STRUCT_STRONGWEAK]]*, align 8
// CHECK: store %[[STRUCT_STRONGWEAK]]* %[[A]], %[[STRUCT_STRONGWEAK]]** %[[A_ADDR]], align 8
// CHECK: %[[V0:.*]] = load %[[STRUCT_STRONGWEAK]]*, %[[STRUCT_STRONGWEAK]]** %[[A_ADDR]], align 8
Expand Down
6 changes: 3 additions & 3 deletions clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct LargeStructTwoMember {
struct LargeStructOneMember g_s;
#endif

// X86-LABEL: define void @foo(%struct.Mat4X4* noalias sret %agg.result, %struct.Mat3X3* byval(%struct.Mat3X3) align 4 %in)
// X86-LABEL: define void @foo(%struct.Mat4X4* noalias sret align 4 %agg.result, %struct.Mat3X3* byval(%struct.Mat3X3) align 4 %in)
// AMDGCN-LABEL: define %struct.Mat4X4 @foo([9 x i32] %in.coerce)
Mat4X4 __attribute__((noinline)) foo(Mat3X3 in) {
Mat4X4 out;
Expand All @@ -63,8 +63,8 @@ kernel void ker(global Mat3X3 *in, global Mat4X4 *out) {
out[0] = foo(in[1]);
}

// X86-LABEL: define void @foo_large(%struct.Mat64X64* noalias sret %agg.result, %struct.Mat32X32* byval(%struct.Mat32X32) align 4 %in)
// AMDGCN-LABEL: define void @foo_large(%struct.Mat64X64 addrspace(5)* noalias sret %agg.result, %struct.Mat32X32 addrspace(5)* byval(%struct.Mat32X32) align 4 %in)
// X86-LABEL: define void @foo_large(%struct.Mat64X64* noalias sret align 4 %agg.result, %struct.Mat32X32* byval(%struct.Mat32X32) align 4 %in)
// AMDGCN-LABEL: define void @foo_large(%struct.Mat64X64 addrspace(5)* noalias sret align 4 %agg.result, %struct.Mat32X32 addrspace(5)* byval(%struct.Mat32X32) align 4 %in)
Mat64X64 __attribute__((noinline)) foo_large(Mat32X32 in) {
Mat64X64 out;
return out;
Expand Down
6 changes: 3 additions & 3 deletions clang/test/CodeGenOpenCL/amdgpu-abi-struct-coerce.cl
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,14 @@ struct_arr16 func_ret_struct_arr16()
return s;
}

// CHECK: define void @func_ret_struct_arr32(%struct.struct_arr32 addrspace(5)* noalias nocapture sret %agg.result)
// CHECK: define void @func_ret_struct_arr32(%struct.struct_arr32 addrspace(5)* noalias nocapture sret align 4 %agg.result)
struct_arr32 func_ret_struct_arr32()
{
struct_arr32 s = { 0 };
return s;
}

// CHECK: define void @func_ret_struct_arr33(%struct.struct_arr33 addrspace(5)* noalias nocapture sret %agg.result)
// CHECK: define void @func_ret_struct_arr33(%struct.struct_arr33 addrspace(5)* noalias nocapture sret align 4 %agg.result)
struct_arr33 func_ret_struct_arr33()
{
struct_arr33 s = { 0 };
Expand Down Expand Up @@ -440,7 +440,7 @@ different_size_type_pair func_different_size_type_pair_ret()
return s;
}

// CHECK: define void @func_flexible_array_ret(%struct.flexible_array addrspace(5)* noalias nocapture sret %agg.result)
// CHECK: define void @func_flexible_array_ret(%struct.flexible_array addrspace(5)* noalias nocapture sret align 4 %agg.result)
flexible_array func_flexible_array_ret()
{
flexible_array s = { 0 };
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGenOpenCLCXX/addrspace-of-this.cl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ __kernel void test__global() {
// Test the address space of 'this' when invoking the operator+
// COMMON: [[C1GEN:%[.a-z0-9]+]] = addrspacecast %class.C* %c1 to %class.C addrspace(4)*
// COMMON: [[C2GEN:%[.a-z0-9]+]] = addrspacecast %class.C* %c2 to %class.C addrspace(4)*
// COMMON: call spir_func void @_ZNU3AS41CplERU3AS4KS_(%class.C* sret %c3, %class.C addrspace(4)* [[C1GEN]], %class.C addrspace(4)* dereferenceable(4) [[C2GEN]])
// COMMON: call spir_func void @_ZNU3AS41CplERU3AS4KS_(%class.C* sret align 4 %c3, %class.C addrspace(4)* [[C1GEN]], %class.C addrspace(4)* dereferenceable(4) [[C2GEN]])

// Test the address space of 'this' when invoking the move constructor
// COMMON: [[C4GEN:%[.a-z0-9]+]] = addrspacecast %class.C* %c4 to %class.C addrspace(4)*
Expand All @@ -134,7 +134,7 @@ __kernel void test__global() {

// Tests address space of inline members
//COMMON: @_ZNU3AS41C3getEv(%class.C addrspace(4)* %this)
//COMMON: @_ZNU3AS41CplERU3AS4KS_(%class.C* noalias sret %agg.result, %class.C addrspace(4)* %this
//COMMON: @_ZNU3AS41CplERU3AS4KS_(%class.C* noalias sret align 4 %agg.result, %class.C addrspace(4)* %this
#define TEST(AS) \
__kernel void test##AS() { \
AS C c; \
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Modules/templates.mm
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void testWithAttributes() {

// Check that returnNonTrivial doesn't return Class0<S0> directly in registers.

// CHECK: declare void @_Z16returnNonTrivialv(%struct.Class0* sret)
// CHECK: declare void @_Z16returnNonTrivialv(%struct.Class0* sret align 8)

@import template_nontrivial0;
@import template_nontrivial1;
Expand Down