Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / vtable-pointer-initialization-address-space.cpp
blob247864862fecf817f1d6cd5834d91ff75173f2e4
1 // RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -std=c++11 -emit-llvm -o - | FileCheck %s
3 struct Field {
4 Field();
5 ~Field();
6 };
8 struct Base {
9 Base();
10 ~Base();
13 struct A : Base {
14 A();
15 ~A();
17 virtual void f();
19 Field field;
22 // CHECK-LABEL: define{{.*}} void @_ZN1AC2Ev(ptr {{[^,]*}} %this) unnamed_addr
23 // CHECK: call void @_ZN4BaseC2Ev(
24 // CHECK: store ptr addrspace(1) getelementptr inbounds ({ [3 x ptr addrspace(1)] }, ptr addrspace(1) @_ZTV1A, i32 0, inrange i32 0, i32 2)
25 // CHECK: call void @_ZN5FieldC1Ev(
26 // CHECK: ret void
27 A::A() { }
29 // CHECK-LABEL: define{{.*}} void @_ZN1AD2Ev(ptr {{[^,]*}} %this) unnamed_addr
30 // CHECK: store ptr addrspace(1) getelementptr inbounds ({ [3 x ptr addrspace(1)] }, ptr addrspace(1) @_ZTV1A, i32 0, inrange i32 0, i32 2)
31 // CHECK: call void @_ZN5FieldD1Ev(
32 // CHECK: call void @_ZN4BaseD2Ev(
33 // CHECK: ret void
34 A::~A() { }
36 struct B : Base {
37 virtual void f();
39 Field field;
42 void f() { B b; }
44 // CHECK-LABEL: define linkonce_odr void @_ZN1BC1Ev(ptr {{[^,]*}} %this) unnamed_addr
45 // CHECK: call void @_ZN1BC2Ev(
47 // CHECK-LABEL: define linkonce_odr void @_ZN1BD1Ev(ptr {{[^,]*}} %this) unnamed_addr
48 // CHECK: call void @_ZN1BD2Ev(
50 // CHECK-LABEL: define linkonce_odr void @_ZN1BC2Ev(ptr {{[^,]*}} %this) unnamed_addr
51 // CHECK: call void @_ZN4BaseC2Ev(
52 // CHECK: store ptr addrspace(1) getelementptr inbounds ({ [3 x ptr addrspace(1)] }, ptr addrspace(1) @_ZTV1B, i32 0, inrange i32 0, i32 2)
53 // CHECK: call void @_ZN5FieldC1Ev
54 // CHECK: ret void
56 // CHECK-LABEL: define linkonce_odr void @_ZN1BD2Ev(ptr {{[^,]*}} %this) unnamed_addr
57 // CHECK: store ptr addrspace(1) getelementptr inbounds ({ [3 x ptr addrspace(1)] }, ptr addrspace(1) @_ZTV1B, i32 0, inrange i32 0, i32 2)
58 // CHECK: call void @_ZN5FieldD1Ev(
59 // CHECK: call void @_ZN4BaseD2Ev(
60 // CHECK: ret void