|
1 |
| -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics \ |
| 1 | +// RUN: %clang_cc1 %s -x c++ -std=c++20 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics \ |
2 | 2 | // RUN: -emit-llvm -o - | FileCheck --check-prefixes=CHECK,NODISC %s
|
3 | 3 |
|
4 |
| -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics \ |
| 4 | +// RUN: %clang_cc1 %s -x c++ -std=c++20 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics \ |
5 | 5 | // RUN: -fptrauth-vtable-pointer-type-discrimination \
|
6 | 6 | // RUN: -emit-llvm -o - | FileCheck --check-prefixes=CHECK,TYPE %s
|
7 | 7 |
|
8 |
| -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics \ |
| 8 | +// RUN: %clang_cc1 %s -x c++ -std=c++20 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics \ |
9 | 9 | // RUN: -fptrauth-vtable-pointer-address-discrimination \
|
10 | 10 | // RUN: -emit-llvm -o - | FileCheck --check-prefixes=CHECK,ADDR %s
|
11 | 11 |
|
12 |
| -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics \ |
| 12 | +// RUN: %clang_cc1 %s -x c++ -std=c++20 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics \ |
13 | 13 | // RUN: -fptrauth-vtable-pointer-type-discrimination \
|
14 | 14 | // RUN: -fptrauth-vtable-pointer-address-discrimination \
|
15 | 15 | // RUN: -emit-llvm -o - | FileCheck --check-prefixes=CHECK,BOTH %s
|
16 | 16 |
|
17 |
| -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics \ |
| 17 | +// RUN: %clang_cc1 %s -x c++ -std=c++20 -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics \ |
18 | 18 | // RUN: -emit-llvm -o - | FileCheck --check-prefixes=CHECK,NODISC %s
|
19 | 19 |
|
20 |
| -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics \ |
| 20 | +// RUN: %clang_cc1 %s -x c++ -std=c++20 -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics \ |
21 | 21 | // RUN: -fptrauth-vtable-pointer-type-discrimination \
|
22 | 22 | // RUN: -emit-llvm -o - | FileCheck --check-prefixes=CHECK,TYPE %s
|
23 | 23 |
|
24 |
| -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics \ |
| 24 | +// RUN: %clang_cc1 %s -x c++ -std=c++20 -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics \ |
25 | 25 | // RUN: -fptrauth-vtable-pointer-address-discrimination \
|
26 | 26 | // RUN: -emit-llvm -o - | FileCheck --check-prefixes=CHECK,ADDR %s
|
27 | 27 |
|
28 |
| -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics \ |
| 28 | +// RUN: %clang_cc1 %s -x c++ -std=c++20 -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics \ |
29 | 29 | // RUN: -fptrauth-vtable-pointer-type-discrimination \
|
30 | 30 | // RUN: -fptrauth-vtable-pointer-address-discrimination \
|
31 | 31 | // RUN: -emit-llvm -o - | FileCheck --check-prefixes=CHECK,BOTH %s
|
@@ -78,6 +78,27 @@ struct authenticated(default_key, default_address_discrimination, custom_discrim
|
78 | 78 | virtual void g();
|
79 | 79 | };
|
80 | 80 |
|
| 81 | +// CHECK: @_ZTVN5test19ConstEvalE = external unnamed_addr constant { [3 x ptr] }, align 8 |
| 82 | +// CHECK: @_ZN5test12ceE = global %{{.*}} { ptr ptrauth (ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTVN5test19ConstEvalE, i32 0, i32 0, i32 2), i32 2, i64 0, ptr @_ZN5test12ceE) }, align 8 |
| 83 | +// CHECK: @_ZTVN5test116ConstEvalDerivedE = linkonce_odr unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr @_ZTIN5test116ConstEvalDerivedE, ptr ptrauth (ptr @_ZN5test19ConstEval1fEv, i32 0, i64 26259, ptr getelementptr inbounds ({ [3 x ptr] }, ptr @_ZTVN5test116ConstEvalDerivedE, i32 0, i32 0, i32 2))] },{{.*}}align 8 |
| 84 | +// CHECK: @_ZN5test13cedE = global { ptr } { ptr ptrauth (ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTVN5test116ConstEvalDerivedE, i32 0, i32 0, i32 2), i32 2, i64 0, ptr @_ZN5test13cedE) }, align 8 |
| 85 | + |
| 86 | +struct authenticated(default_key, address_discrimination, no_extra_discrimination) ConstEval { |
| 87 | + consteval ConstEval() {} |
| 88 | + virtual void f(); |
| 89 | +}; |
| 90 | + |
| 91 | +// clang used to bail out with error message "could not emit constant value abstractly". |
| 92 | +ConstEval ce; |
| 93 | + |
| 94 | +struct ConstEvalDerived : public ConstEval { |
| 95 | +public: |
| 96 | + consteval ConstEvalDerived() {} |
| 97 | +}; |
| 98 | + |
| 99 | +// clang used to emit an undef initializer. |
| 100 | +ConstEvalDerived ced; |
| 101 | + |
81 | 102 | template <typename T>
|
82 | 103 | struct SubClass : T {
|
83 | 104 | virtual void g();
|
|
0 commit comments