Follow up to https://github.com/llvm/llvm-project/pull/111902. Makes sure all the `no_unique_address` tests are in the same place and we don't rely on the host target triple (which means we don't need to account for `[[msvc::no_unique_address]]` on Windows). Now that we don't compile with the host compiler, this patch also adds `-c` to the compilation command since we don't actually need the linked binary in the test anyway (and on Darwin linking through Clang requires the `xcrun` prefix to set up the SDK paths, etc.). We already do this in `no_unique_address-with-bitfields.cpp` anyway.
25 lines
620 B
C++
25 lines
620 B
C++
// XFAIL: *
|
|
|
|
// RUN: %clang --target=x86_64-apple-macosx -c -gdwarf -o %t %s
|
|
// RUN: %lldb %t \
|
|
// RUN: -o "expr alignof(OverlappingFields)" \
|
|
// RUN: -o "expr sizeof(OverlappingFields)" \
|
|
// RUN: -o exit | FileCheck %s
|
|
|
|
// CHECK: (lldb) expr alignof(OverlappingFields)
|
|
// CHECK-NEXT: ${{.*}} = 4
|
|
// CHECK: (lldb) expr sizeof(OverlappingFields)
|
|
// CHECK-NEXT: ${{.*}} = 8
|
|
|
|
struct Empty {};
|
|
|
|
struct OverlappingFields {
|
|
char y;
|
|
[[no_unique_address]] Empty e;
|
|
int z;
|
|
} g_overlapping_struct;
|
|
static_assert(alignof(OverlappingFields) == 4);
|
|
static_assert(sizeof(OverlappingFields) == 8);
|
|
|
|
int main() {}
|