Skip to content

Commit 0e2317a

Browse files
committed
[CUDA] Precommit test for VTable codegen
1 parent d1d3e22 commit 0e2317a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// RUN: %clang_cc1 -fcuda-is-device -triple amdgcn-amd-amdhsa -target-cpu gfx942 \
2+
// RUN: -emit-llvm -xhip %s -o - | FileCheck %s
3+
4+
// CHECK: @_ZTV1C = linkonce_odr unnamed_addr addrspace(1) constant { [5 x ptr addrspace(1)], [4 x ptr addrspace(1)] } { [5 x ptr addrspace(1)] [ptr addrspace(1) null, ptr addrspace(1) null, ptr addrspace(1) addrspacecast (ptr @_ZN1B2f2Ev to ptr addrspace(1)), ptr addrspace(1) null, ptr addrspace(1) addrspacecast (ptr @_ZN1C2f1Ev to ptr addrspace(1))], [4 x ptr addrspace(1)] [ptr addrspace(1) inttoptr (i64 -8 to ptr addrspace(1)), ptr addrspace(1) null, ptr addrspace(1) null, ptr addrspace(1) addrspacecast (ptr @_ZN1C2f1Ev to ptr addrspace(1))] }, comdat, align 8
5+
// CHECK: @_ZTV1B = linkonce_odr unnamed_addr addrspace(1) constant { [3 x ptr addrspace(1)] } { [3 x ptr addrspace(1)] [ptr addrspace(1) null, ptr addrspace(1) null, ptr addrspace(1) addrspacecast (ptr @_ZN1B2f2Ev to ptr addrspace(1))] }, comdat, align 8
6+
// CHECK: @_ZTV1A = linkonce_odr unnamed_addr addrspace(1) constant { [4 x ptr addrspace(1)] } { [4 x ptr addrspace(1)] [ptr addrspace(1) null, ptr addrspace(1) null, ptr addrspace(1) null, ptr addrspace(1) addrspacecast (ptr @__cxa_pure_virtual to ptr addrspace(1))] }, comdat, align 8
7+
// CHECK: @__hip_cuid_ = addrspace(1) global i8 0
8+
// CHECK: @llvm.compiler.used = appending addrspace(1) global [1 x ptr] [ptr addrspacecast (ptr addrspace(1) @__hip_cuid_ to ptr)], section "llvm.metadata"
9+
// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
10+
11+
struct A {
12+
__attribute__((device)) A() { }
13+
virtual void neither_device_nor_host_f() = 0 ;
14+
__attribute__((device)) virtual void f1() = 0;
15+
16+
};
17+
18+
struct B {
19+
__attribute__((device)) B() { }
20+
__attribute__((device)) virtual void f2() { };
21+
};
22+
23+
struct C : public B, public A {
24+
__attribute__((device)) C() : B(), A() { }
25+
26+
virtual void neither_device_nor_host_f() override { }
27+
__attribute__((device)) virtual void f1() override { }
28+
29+
};
30+
31+
__attribute__((device)) void test() {
32+
C obj;
33+
}

0 commit comments

Comments
 (0)