Files
TheRock/compiler/amd-llvm/clang/test/CodeGenCXX/dynamic-cast-hint.cpp
T
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

60 lines
2.4 KiB
C++

// RUN: %clang_cc1 -triple x86_64-apple-darwin12 -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,64BIT
// RUN: %clang_cc1 -triple x86_64-apple-darwin12 -emit-llvm -std=c++98 -o - %s | FileCheck %s --check-prefixes=CHECK,64BIT
// RUN: %clang_cc1 -triple x86_64-apple-darwin12 -emit-llvm -std=c++11 -o - %s | FileCheck %s --check-prefixes=CHECK,64BIT
// RUN: %clang_cc1 -triple i686-apple-darwin12 -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,32BIT
class A { protected: virtual ~A() {} };
class B { protected: virtual ~B() {} };
class C : A { char x; };
class D : public A { short y; };
class E : public A, public B { int z; };
class F : public virtual A { long long w; };
class G : virtual A { long long w; };
class H : public E { int a; };
class I : public F { char b; };
class J : public H { char q; };
class K : public C, public B { char q; };
class XA : public A { };
class XB : public A { };
class XC : public virtual A { };
class X : public XA, public XB, public XC { };
void test(A *a, B *b) {
volatile C *ac = dynamic_cast<C *>(a);
// CHECK: ptr @_ZTI1A, ptr @_ZTI1C, [[INT:i64|i32]] -2)
volatile D *ad = dynamic_cast<D *>(a);
// CHECK: ptr @_ZTI1A, ptr @_ZTI1D, [[INT]] 0)
volatile E *ae = dynamic_cast<E *>(a);
// CHECK: ptr @_ZTI1A, ptr @_ZTI1E, [[INT]] 0)
volatile F *af = dynamic_cast<F *>(a);
// CHECK: ptr @_ZTI1A, ptr @_ZTI1F, [[INT]] -1)
volatile G *ag = dynamic_cast<G *>(a);
// CHECK: ptr @_ZTI1A, ptr @_ZTI1G, [[INT]] -2)
volatile H *ah = dynamic_cast<H *>(a);
// CHECK: ptr @_ZTI1A, ptr @_ZTI1H, [[INT]] 0)
volatile I *ai = dynamic_cast<I *>(a);
// CHECK: ptr @_ZTI1A, ptr @_ZTI1I, [[INT]] -1)
volatile J *aj = dynamic_cast<J *>(a);
// CHECK: ptr @_ZTI1A, ptr @_ZTI1J, [[INT]] 0)
volatile K *ak = dynamic_cast<K *>(a);
// CHECK: ptr @_ZTI1A, ptr @_ZTI1K, [[INT]] -2)
volatile X *ax = dynamic_cast<X *>(a);
// CHECK: ptr @_ZTI1A, ptr @_ZTI1X, [[INT]] -1)
volatile E *be = dynamic_cast<E *>(b);
// 64BIT: ptr @_ZTI1B, ptr @_ZTI1E, [[INT]] 8)
// 32BIT: ptr @_ZTI1B, ptr @_ZTI1E, [[INT]] 4)
volatile G *bg = dynamic_cast<G *>(b);
// CHECK: ptr @_ZTI1B, ptr @_ZTI1G, [[INT]] -2)
volatile J *bj = dynamic_cast<J *>(b);
// 64BIT: ptr @_ZTI1B, ptr @_ZTI1J, [[INT]] 8)
// 32BIT: ptr @_ZTI1B, ptr @_ZTI1J, [[INT]] 4)
volatile K *bk = dynamic_cast<K *>(b);
// 64BIT: ptr @_ZTI1B, ptr @_ZTI1K, [[INT]] 16)
// 32BIT: ptr @_ZTI1B, ptr @_ZTI1K, [[INT]] 8)
}