1 // RUN: %clang_cc1 -triple x86_64-windows-gnu -emit-llvm -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -triple powerpc64le-windows-gnu -emit-llvm -o - %s | FileCheck %s
4 // An empty struct is handled as a struct with a dummy i8, on all targets.
5 // Most targets treat an empty struct return value as essentially void - but
6 // some don't. (Currently, at least x86_64-windows-* and powerpc64le-* don't
9 // When intializing a struct with such a no_unique_address member, make sure we
10 // don't write the dummy i8 into the struct where there's no space allocated for
13 // This can only be tested with targets that don't treat empty struct returns as
20 [[no_unique_address
]] S y
;
23 Z::Z() : x(111), y(f()) {}
25 // CHECK: define {{.*}} @_ZN1ZC2Ev
26 // CHECK: %call = call i8 @_Z1fv()
27 // CHECK-NEXT: ret void
30 // Check that the constructor for an empty member gets called with the right
38 [[no_unique_address
]] S2 y
;
43 // CHECK: define {{.*}} @_ZN2Z2C2Ev(ptr {{.*}} %this)
44 // CHECK: %this.addr = alloca ptr
45 // CHECK: store ptr %this, ptr %this.addr
46 // CHECK: %this1 = load ptr, ptr %this.addr
47 // CHECK: call void @_ZN2S2C1Ev(ptr {{.*}} %this1)