Files
TheRock/compiler/amd-llvm/clang/test/CodeGenCXX/override-layout-virtual-base.cpp
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

57 lines
1.8 KiB
C++

// RUN: %clang_cc1 -w -triple=x86_64-pc-win32 -fms-compatibility -fdump-record-layouts-simple -foverride-record-layout=%S/Inputs/override-layout-virtual-base.layout %s | FileCheck --check-prefix=SIMPLE %s
// RUN: %clang_cc1 -w -triple=x86_64-pc-win32 -fms-compatibility -fdump-record-layouts -foverride-record-layout=%S/Inputs/override-layout-virtual-base.layout %s | FileCheck %s
struct S1 {
int a;
};
struct S2 : virtual S1 {
virtual void foo() {}
};
// SIMPLE: Type: struct S3
// SIMPLE: FieldOffsets: [64]
struct S3 : S2 {
char b;
};
struct S4 {
};
struct S5 : S4 {
virtual void foo() {}
};
// CHECK: *** Dumping AST Record Layout
// CHECK: 0 | struct S2
// CHECK-NEXT: 0 | (S2 vftable pointer)
// CHECK-NEXT: 8 | (S2 vbtable pointer)
// CHECK-NEXT: 8 | struct S1 (virtual base)
// CHECK-NEXT: 8 | int a
// CHECK-NEXT: | [sizeof=8, align=8,
// CHECK-NEXT: | nvsize=8, nvalign=8]
// CHECK: *** Dumping AST Record Layout
// CHECK: 0 | struct S3
// CHECK-NEXT: 0 | struct S2 (primary base)
// CHECK-NEXT: 0 | (S2 vftable pointer)
// CHECK-NEXT: 8 | (S2 vbtable pointer)
// CHECK-NEXT: 8 | char b
// CHECK-NEXT: 16 | struct S1 (virtual base)
// CHECK-NEXT: 16 | int a
// CHECK-NEXT: | [sizeof=24, align=8,
// CHECK-NEXT: | nvsize=16, nvalign=8]
// CHECK: *** Dumping AST Record Layout
// CHECK: 0 | struct S5
// CHECK-NEXT: 0 | (S5 vftable pointer)
// CHECK-NEXT: 0 | struct S4 (base) (empty)
// CHECK-NEXT: | [sizeof=8, align=8,
// CHECK-NEXT: | nvsize=8, nvalign=8]
void use_structs() {
S1 s1s[sizeof(S1)];
S2 s2s[sizeof(S2)];
S3 s3s[sizeof(S3)];
S4 s4s[sizeof(S4)];
S5 s5s[sizeof(S5)];
}