Skip to content

Commit 1b9a6e5

Browse files
committed
[CodeGenCXX] Convert some tests to opaque pointers (NFC)
Conversion done using the script at https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34. These are tests where the conversion worked out of the box and no manual fixup was performed.
1 parent 2d433ae commit 1b9a6e5

File tree

349 files changed

+5597
-5760
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

349 files changed

+5597
-5760
lines changed

clang/test/CodeGenCXX/2009-12-23-MissingSext.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -no-opaque-pointers %s -triple x86_64-unknown-unknown -emit-llvm -o - | FileCheck %s
1+
// RUN: %clang_cc1 %s -triple x86_64-unknown-unknown -emit-llvm -o - | FileCheck %s
22
// The store of p.y into the temporary was not
33
// getting extended to 32 bits, so uninitialized
44
// bits of the temporary were used. 7366161.
@@ -8,11 +8,11 @@ struct foo {
88
};
99
int bar(struct foo p, int x) {
1010
// CHECK: bar
11-
// CHECK: %[[val:.*]] = load i32, i32* {{.*}}
11+
// CHECK: %[[val:.*]] = load i32, ptr {{.*}}
1212
// CHECK-NEXT: ashr i32 %[[val]]
13-
// CHECK: = load i32, i32* {{.*}}
14-
// CHECK: = load i32, i32* {{.*}}
15-
// CHECK: %[[val:.*]] = load i32, i32* {{.*}}
13+
// CHECK: = load i32, ptr {{.*}}
14+
// CHECK: = load i32, ptr {{.*}}
15+
// CHECK: %[[val:.*]] = load i32, ptr {{.*}}
1616
// CHECK-NEXT: ashr i32 %[[val]]
1717
x = (p.y > x ? x : p.y);
1818
return x;

clang/test/CodeGenCXX/2012-03-16-StoreAlign.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -no-opaque-pointers -emit-llvm -o - -triple x86_64-apple-darwin %s | FileCheck %s
1+
// RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-apple-darwin %s | FileCheck %s
22
// <rdar://problem/11043589>
33

44
struct Length {
@@ -28,7 +28,7 @@ struct Foo {
2828
};
2929

3030
// CHECK: @_ZZN3Foo19getPageSizeFromNameERK6LengthE10legalWidth = linkonce_odr global %struct.Length zeroinitializer, align 4
31-
// CHECK: store float %{{.*}}, float* getelementptr inbounds (%struct.Length, %struct.Length* @_ZZN3Foo19getPageSizeFromNameERK6LengthE10legalWidth, i32 0, i32 0), align 4
31+
// CHECK: store float %{{.*}}, ptr @_ZZN3Foo19getPageSizeFromNameERK6LengthE10legalWidth, align 4
3232

3333
bool bar(Length &b) {
3434
Foo f;

clang/test/CodeGenCXX/ARM/exception-alignment.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Bug: https://bugs.llvm.org/show_bug.cgi?id=42668
22
// REQUIRES: arm-registered-target
33

4-
// RUN: %clang_cc1 -no-opaque-pointers -triple armv8-arm-none-eabi -emit-llvm -target-cpu generic -Os -fcxx-exceptions -o - -x c++ %s | FileCheck --check-prefixes=CHECK,A8 %s
5-
// RUN: %clang_cc1 -no-opaque-pointers -triple armv8-unknown-linux-android -emit-llvm -target-cpu generic -Os -fcxx-exceptions -o - -x c++ %s | FileCheck --check-prefixes=CHECK,A16 %s
4+
// RUN: %clang_cc1 -triple armv8-arm-none-eabi -emit-llvm -target-cpu generic -Os -fcxx-exceptions -o - -x c++ %s | FileCheck --check-prefixes=CHECK,A8 %s
5+
// RUN: %clang_cc1 -triple armv8-unknown-linux-android -emit-llvm -target-cpu generic -Os -fcxx-exceptions -o - -x c++ %s | FileCheck --check-prefixes=CHECK,A16 %s
66

7-
// CHECK: [[E:%[A-z0-9]+]] = tail call i8* @__cxa_allocate_exception
8-
// CHECK-NEXT: [[BC:%[A-z0-9]+]] = bitcast i8* [[E]] to <2 x i64>*
9-
// A8-NEXT: store <2 x i64> <i64 1, i64 2>, <2 x i64>* [[BC]], align 8
10-
// A16-NEXT: store <2 x i64> <i64 1, i64 2>, <2 x i64>* [[BC]], align 16
7+
// CHECK: [[E:%[A-z0-9]+]] = tail call ptr @__cxa_allocate_exception
8+
// A8-NEXT: store <2 x i64> <i64 1, i64 2>, ptr [[E]], align 8
9+
// A16-NEXT: store <2 x i64> <i64 1, i64 2>, ptr [[E]], align 16
1110
#include <arm_neon.h>
1211

1312
int main(void) {

clang/test/CodeGenCXX/PR19955.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
// RUN: %clang_cc1 -no-opaque-pointers -triple i686-windows-msvc -fms-extensions -fno-rtti -emit-llvm -std=c++1y -O0 -o - %s | FileCheck %s
2-
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-windows-msvc -fms-extensions -fno-rtti -emit-llvm -std=c++1y -O0 -o - %s | FileCheck %s --check-prefix X64
1+
// RUN: %clang_cc1 -triple i686-windows-msvc -fms-extensions -fno-rtti -emit-llvm -std=c++1y -O0 -o - %s | FileCheck %s
2+
// RUN: %clang_cc1 -triple x86_64-windows-msvc -fms-extensions -fno-rtti -emit-llvm -std=c++1y -O0 -o - %s | FileCheck %s --check-prefix X64
33

44
extern int __declspec(dllimport) var;
55
extern void __declspec(dllimport) fun();
66

77
extern int *varp;
88
int *varp = &var;
9-
// CHECK-DAG: @"?varp@@3PAHA" = dso_local global i32* null
10-
// X64-DAG: @"?varp@@3PEAHEA" = dso_local global i32* null
9+
// CHECK-DAG: @"?varp@@3PAHA" = dso_local global ptr null
10+
// X64-DAG: @"?varp@@3PEAHEA" = dso_local global ptr null
1111

1212
extern void (*funp)();
1313
void (*funp)() = &fun;
14-
// CHECK-DAG: @"?funp@@3P6AXXZA" = dso_local global void ()* null
15-
// X64-DAG: @"?funp@@3P6AXXZEA" = dso_local global void ()* null
14+
// CHECK-DAG: @"?funp@@3P6AXXZA" = dso_local global ptr null
15+
// X64-DAG: @"?funp@@3P6AXXZEA" = dso_local global ptr null
1616

1717
// CHECK-LABEL: @"??__Evarp@@YAXXZ"
18-
// CHECK-DAG: store i32* @"?var@@3HA", i32** @"?varp@@3PAHA"
18+
// CHECK-DAG: store ptr @"?var@@3HA", ptr @"?varp@@3PAHA"
1919

2020
// X64-LABEL: @"??__Evarp@@YAXXZ"
21-
// X64-DAG: store i32* @"?var@@3HA", i32** @"?varp@@3PEAHEA"
21+
// X64-DAG: store ptr @"?var@@3HA", ptr @"?varp@@3PEAHEA"
2222

2323
// CHECK-LABEL: @"??__Efunp@@YAXXZ"()
24-
// CHECK-DAG: store void ()* @"?fun@@YAXXZ", void ()** @"?funp@@3P6AXXZA"
24+
// CHECK-DAG: store ptr @"?fun@@YAXXZ", ptr @"?funp@@3P6AXXZA"
2525

2626
// X64-LABEL: @"??__Efunp@@YAXXZ"()
27-
// X64-DAG: store void ()* @"?fun@@YAXXZ", void ()** @"?funp@@3P6AXXZEA"
27+
// X64-DAG: store ptr @"?fun@@YAXXZ", ptr @"?funp@@3P6AXXZEA"

clang/test/CodeGenCXX/PR26569.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -no-opaque-pointers -triple i686-pc-win32 -fms-extensions -emit-llvm -O1 -disable-llvm-passes %s -o - | FileCheck %s
1+
// RUN: %clang_cc1 -triple i686-pc-win32 -fms-extensions -emit-llvm -O1 -disable-llvm-passes %s -o - | FileCheck %s
22

33
class __declspec(dllimport) A {
44
virtual void m_fn1();
@@ -9,12 +9,12 @@ class B : virtual A {};
99
extern template class __declspec(dllimport) B<int>;
1010
class __declspec(dllexport) C : B<int> {};
1111

12-
// CHECK-DAG: @[[VTABLE_C:.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"??_R4C@@6B@" to i8*), i8* bitcast (void (%class.A*)* @"?m_fn1@A@@EAEXXZ" to i8*)] }
13-
// CHECK-DAG: @[[VTABLE_B:.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"??_R4?$B@H@@6B@" to i8*), i8* bitcast (void (%class.A*)* @"?m_fn1@A@@EAEXXZ" to i8*)] }, comdat($"??_S?$B@H@@6B@")
14-
// CHECK-DAG: @[[VTABLE_A:.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"??_R4A@@6B@" to i8*), i8* bitcast (void (%class.A*)* @"?m_fn1@A@@EAEXXZ" to i8*)] }, comdat($"??_SA@@6B@")
12+
// CHECK-DAG: @[[VTABLE_C:.*]] = private unnamed_addr constant { [2 x ptr] } { [2 x ptr] [ptr @"??_R4C@@6B@", ptr @"?m_fn1@A@@EAEXXZ"] }
13+
// CHECK-DAG: @[[VTABLE_B:.*]] = private unnamed_addr constant { [2 x ptr] } { [2 x ptr] [ptr @"??_R4?$B@H@@6B@", ptr @"?m_fn1@A@@EAEXXZ"] }, comdat($"??_S?$B@H@@6B@")
14+
// CHECK-DAG: @[[VTABLE_A:.*]] = private unnamed_addr constant { [2 x ptr] } { [2 x ptr] [ptr @"??_R4A@@6B@", ptr @"?m_fn1@A@@EAEXXZ"] }, comdat($"??_SA@@6B@")
1515

16-
// CHECK-DAG: @"??_7C@@6B@" = dllexport unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @[[VTABLE_C]], i32 0, i32 0, i32 1)
17-
// CHECK-DAG: @"??_S?$B@H@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @[[VTABLE_B]], i32 0, i32 0, i32 1)
18-
// CHECK-DAG: @"??_SA@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @[[VTABLE_A]], i32 0, i32 0, i32 1)
16+
// CHECK-DAG: @"??_7C@@6B@" = dllexport unnamed_addr alias ptr, getelementptr inbounds ({ [2 x ptr] }, ptr @[[VTABLE_C]], i32 0, i32 0, i32 1)
17+
// CHECK-DAG: @"??_S?$B@H@@6B@" = unnamed_addr alias ptr, getelementptr inbounds ({ [2 x ptr] }, ptr @[[VTABLE_B]], i32 0, i32 0, i32 1)
18+
// CHECK-DAG: @"??_SA@@6B@" = unnamed_addr alias ptr, getelementptr inbounds ({ [2 x ptr] }, ptr @[[VTABLE_A]], i32 0, i32 0, i32 1)
1919

2020
// CHECK-DAG: @"??_8?$B@H@@7B@" = available_externally dllimport unnamed_addr constant [2 x i32] [i32 0, i32 4]

clang/test/CodeGenCXX/PR28523.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -no-opaque-pointers -std=c++14 -verify -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
1+
// RUN: %clang_cc1 -std=c++14 -verify -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
22
// expected-no-diagnostics
33

44
template <class F> void parallel_loop(F &&f) { f(0); }
@@ -8,7 +8,7 @@ int main() {
88
// CHECK: [[X_ADDR:%.+]] = alloca i32,
99
int x;
1010
// CHECK: getelementptr inbounds
11-
// CHECK: store i32* [[X_ADDR]], i32** %
11+
// CHECK: store ptr [[X_ADDR]], ptr %
1212
// CHECK: call
1313
parallel_loop([&](auto y) {
1414
#pragma clang __debug captured

clang/test/CodeGenCXX/RelativeVTablesABI/child-inheritted-from-parent-in-comdat.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Cross comdat example
22
// Parent VTable is in a comdat section.
33

4-
// RUN: %clang_cc1 -no-opaque-pointers %s -triple=aarch64-unknown-fuchsia -O1 -S -o - -emit-llvm -fhalf-no-semantic-interposition | FileCheck %s
4+
// RUN: %clang_cc1 %s -triple=aarch64-unknown-fuchsia -O1 -S -o - -emit-llvm -fhalf-no-semantic-interposition | FileCheck %s
55

66
// The inline function is emitted in each module with the same comdat
77
// CHECK: $_ZTS1A = comdat any
@@ -13,15 +13,15 @@
1313
// CHECK: $_ZTI1A.rtti_proxy = comdat any
1414

1515
// The VTable for B is emitted here since it has a key function which is defined in this module
16-
// CHECK: @_ZTV1B.local = private unnamed_addr constant { [3 x i32] } { [3 x i32] [i32 0, i32 trunc (i64 sub (i64 ptrtoint ({ i8*, i8*, i8* }** @_ZTI1B.rtti_proxy to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [3 x i32] }, { [3 x i32] }* @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (void (%class.B*)* dso_local_equivalent @_ZN1B3fooEv to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [3 x i32] }, { [3 x i32] }* @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32)] }, align 4
16+
// CHECK: @_ZTV1B.local = private unnamed_addr constant { [3 x i32] } { [3 x i32] [i32 0, i32 trunc (i64 sub (i64 ptrtoint (ptr @_ZTI1B.rtti_proxy to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [3 x i32] }, ptr @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @_ZN1B3fooEv to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [3 x i32] }, ptr @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32)] }, align 4
1717

1818
// The VTable for A is emitted here and in a comdat section since it has no key function, and is used in this module when creating an instance of A (in func()).
19-
// CHECK: @_ZTV1A.local = linkonce_odr hidden unnamed_addr constant { [3 x i32] } { [3 x i32] [i32 0, i32 trunc (i64 sub (i64 ptrtoint ({ i8*, i8* }** @_ZTI1A.rtti_proxy to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [3 x i32] }, { [3 x i32] }* @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (void (%class.A*)* dso_local_equivalent @_ZN1A3fooEv to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [3 x i32] }, { [3 x i32] }* @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32)] }, comdat($_ZTV1A), align 4
19+
// CHECK: @_ZTV1A.local = linkonce_odr hidden unnamed_addr constant { [3 x i32] } { [3 x i32] [i32 0, i32 trunc (i64 sub (i64 ptrtoint (ptr @_ZTI1A.rtti_proxy to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [3 x i32] }, ptr @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @_ZN1A3fooEv to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [3 x i32] }, ptr @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32)] }, comdat($_ZTV1A), align 4
2020

21-
// CHECK: @_ZTV1B ={{.*}} unnamed_addr alias { [3 x i32] }, { [3 x i32] }* @_ZTV1B.local
22-
// CHECK: @_ZTV1A = linkonce_odr unnamed_addr alias { [3 x i32] }, { [3 x i32] }* @_ZTV1A.local
21+
// CHECK: @_ZTV1B ={{.*}} unnamed_addr alias { [3 x i32] }, ptr @_ZTV1B.local
22+
// CHECK: @_ZTV1A = linkonce_odr unnamed_addr alias { [3 x i32] }, ptr @_ZTV1A.local
2323

24-
// CHECK: define{{.*}} void @_ZN1B3fooEv(%class.B* {{.*}}%this) unnamed_addr
24+
// CHECK: define{{.*}} void @_ZN1B3fooEv(ptr {{.*}}%this) unnamed_addr
2525
// CHECK-NEXT: entry:
2626
// CHECK-NEXT: ret void
2727
// CHECK-NEXT: }

clang/test/CodeGenCXX/RelativeVTablesABI/child-vtable-in-comdat.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Cross comdat example
22
// Child VTable is in a comdat section.
33

4-
// RUN: %clang_cc1 -no-opaque-pointers %s -triple=aarch64-unknown-fuchsia -O1 -S -o - -emit-llvm | FileCheck %s
4+
// RUN: %clang_cc1 %s -triple=aarch64-unknown-fuchsia -O1 -S -o - -emit-llvm | FileCheck %s
55

66
// A comdat is emitted for B but not A
77
// CHECK-DAG: $_ZTV1B = comdat any
@@ -11,18 +11,18 @@
1111
// CHECK-DAG: $_ZTI1A.rtti_proxy = comdat any
1212

1313
// VTable for B is emitted here since we access it when creating an instance of B. The VTable is also linkonce_odr and in its own comdat.
14-
// CHECK-DAG: @_ZTV1B.local = linkonce_odr hidden unnamed_addr constant { [3 x i32] } { [3 x i32] [i32 0, i32 trunc (i64 sub (i64 ptrtoint ({ i8*, i8*, i8* }** @_ZTI1B.rtti_proxy to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [3 x i32] }, { [3 x i32] }* @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (void (%class.B*)* dso_local_equivalent @_ZN1B3fooEv to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [3 x i32] }, { [3 x i32] }* @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32)] }, comdat($_ZTV1B), align 4
14+
// CHECK-DAG: @_ZTV1B.local = linkonce_odr hidden unnamed_addr constant { [3 x i32] } { [3 x i32] [i32 0, i32 trunc (i64 sub (i64 ptrtoint (ptr @_ZTI1B.rtti_proxy to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [3 x i32] }, ptr @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @_ZN1B3fooEv to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [3 x i32] }, ptr @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32)] }, comdat($_ZTV1B), align 4
1515

1616
// The RTTI objects aren’t that important, but it is good to know that they are emitted here since they are used in the vtable for B, and external references are used for RTTI stuff from A.
17-
// CHECK-DAG: @_ZTVN10__cxxabiv120__si_class_type_infoE = external global i8*
17+
// CHECK-DAG: @_ZTVN10__cxxabiv120__si_class_type_infoE = external global ptr
1818
// CHECK-DAG: @_ZTS1B =
1919
// CHECK-DAG: @_ZTI1A =
2020
// CHECK-DAG: @_ZTI1B =
21-
// CHECK-DAG: @_ZTI1B.rtti_proxy = hidden unnamed_addr constant { i8*, i8*, i8* }* @_ZTI1B, comdat
21+
// CHECK-DAG: @_ZTI1B.rtti_proxy = hidden unnamed_addr constant ptr @_ZTI1B, comdat
2222

2323
// We will emit a vtable for B here, so it does have an alias, but we will not
2424
// emit one for A.
25-
// CHECK: @_ZTV1B = linkonce_odr unnamed_addr alias { [3 x i32] }, { [3 x i32] }* @_ZTV1B.local
25+
// CHECK: @_ZTV1B = linkonce_odr unnamed_addr alias { [3 x i32] }, ptr @_ZTV1B.local
2626
// CHECK-NOT: @_ZTV1A = {{.*}}alias
2727

2828
class A {

clang/test/CodeGenCXX/RelativeVTablesABI/cross-translation-unit-1.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Check the vtable layout for classes with key functions defined in different
22
// translation units. This TU only manifests the vtable for A.
33

4-
// RUN: %clang_cc1 -no-opaque-pointers %s -triple=aarch64-unknown-fuchsia -O1 -S -o - -emit-llvm -fhalf-no-semantic-interposition | FileCheck %s
4+
// RUN: %clang_cc1 %s -triple=aarch64-unknown-fuchsia -O1 -S -o - -emit-llvm -fhalf-no-semantic-interposition | FileCheck %s
55

66
#include "cross-tu-header.h"
77

88
// CHECK: $_ZTI1A.rtti_proxy = comdat any
99

10-
// CHECK: @_ZTV1A.local = private unnamed_addr constant { [4 x i32] } { [4 x i32] [i32 0, i32 trunc (i64 sub (i64 ptrtoint ({ i8*, i8* }** @_ZTI1A.rtti_proxy to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [4 x i32] }, { [4 x i32] }* @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (void (%class.A*)* dso_local_equivalent @_ZN1A3fooEv to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [4 x i32] }, { [4 x i32] }* @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (void (%class.A*)* dso_local_equivalent @_ZN1A3barEv to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [4 x i32] }, { [4 x i32] }* @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32)] }, align 4
11-
// @_ZTV1A ={{.*}} unnamed_addr alias { [4 x i32] }, { [4 x i32] }* @_ZTV1A.local
10+
// CHECK: @_ZTV1A.local = private unnamed_addr constant { [4 x i32] } { [4 x i32] [i32 0, i32 trunc (i64 sub (i64 ptrtoint (ptr @_ZTI1A.rtti_proxy to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [4 x i32] }, ptr @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @_ZN1A3fooEv to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [4 x i32] }, ptr @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @_ZN1A3barEv to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [4 x i32] }, ptr @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32)] }, align 4
11+
// @_ZTV1A ={{.*}} unnamed_addr alias { [4 x i32] }, ptr @_ZTV1A.local
1212

1313
void A::foo() {}
1414
void A_foo(A *a) { a->foo(); }

clang/test/CodeGenCXX/RelativeVTablesABI/cross-translation-unit-2.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
// Check the vtable layout for classes with key functions defined in different
22
// translation units. This TU manifests the vtable for B.
33

4-
// RUN: %clang_cc1 -no-opaque-pointers %s -triple=aarch64-unknown-fuchsia -O1 -S -o - -emit-llvm -fhalf-no-semantic-interposition | FileCheck %s
4+
// RUN: %clang_cc1 %s -triple=aarch64-unknown-fuchsia -O1 -S -o - -emit-llvm -fhalf-no-semantic-interposition | FileCheck %s
55

66
#include "cross-tu-header.h"
77

88
// CHECK: $_ZTI1B.rtti_proxy = comdat any
99

10-
// CHECK: @_ZTV1B.local = private unnamed_addr constant { [4 x i32] } { [4 x i32] [i32 0, i32 trunc (i64 sub (i64 ptrtoint ({ i8*, i8*, i8* }** @_ZTI1B.rtti_proxy to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [4 x i32] }, { [4 x i32] }* @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (void (%class.B*)* dso_local_equivalent @_ZN1B3fooEv to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [4 x i32] }, { [4 x i32] }* @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (void (%class.A*)* dso_local_equivalent @_ZN1A3barEv to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [4 x i32] }, { [4 x i32] }* @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32)] }, align 4
11-
// CHECK: @_ZTV1B ={{.*}} unnamed_addr alias { [4 x i32] }, { [4 x i32] }* @_ZTV1B.local
10+
// CHECK: @_ZTV1B.local = private unnamed_addr constant { [4 x i32] } { [4 x i32] [i32 0, i32 trunc (i64 sub (i64 ptrtoint (ptr @_ZTI1B.rtti_proxy to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [4 x i32] }, ptr @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @_ZN1B3fooEv to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [4 x i32] }, ptr @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @_ZN1A3barEv to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [4 x i32] }, ptr @_ZTV1B.local, i32 0, i32 0, i32 2) to i64)) to i32)] }, align 4
11+
// CHECK: @_ZTV1B ={{.*}} unnamed_addr alias { [4 x i32] }, ptr @_ZTV1B.local
1212

1313
// A::bar() is defined outside of the module that defines the vtable for A
14-
// CHECK: define{{.*}} void @_ZN1A3barEv(%class.A* {{.*}}%this) unnamed_addr
14+
// CHECK: define{{.*}} void @_ZN1A3barEv(ptr {{.*}}%this) unnamed_addr
1515
// CHECK-NEXT: entry:
1616
// CHECK-NEXT: ret void
1717
// CHECK-NEXT: }
1818

19-
// CHECK: define{{.*}} void @_ZN1B3fooEv(%class.B* {{.*}}%this) unnamed_addr
19+
// CHECK: define{{.*}} void @_ZN1B3fooEv(ptr {{.*}}%this) unnamed_addr
2020
// CHECK-NEXT: entry:
2121
// CHECK-NEXT: ret void
2222
// CHECK-NEXT: }

0 commit comments

Comments
 (0)