Debian Codegraph @

clang/test/CodeGenCXX/mangle-fail.cpp

raw
1 // RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=1
2 // RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=2
3 // RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple aarch64-linux-gnu -fptrauth-intrinsics -verify %s -DN=3
4
5 struct A { int a; };
6
7 #if N == 1
8 // ChooseExpr
9 template<class T> void test(int (&)[sizeof(__builtin_choose_expr(true, 1, 1), T())]) {} // expected-error {{cannot yet mangle}}
10 template void test<int>(int (&)[sizeof(int)]);
11
12 #elif N == 2
13 // CompoundLiteralExpr
14 template<class T> void test(int (&)[sizeof((A){}, T())]) {} // expected-error {{cannot yet mangle}}
15 template void test<int>(int (&)[sizeof(A)]);
16
17 #elif N == 3
18 // __builtin_ptrauth_type_discriminator
19 template <class T, unsigned disc>
20 struct S1 {};
21
22 template<class T>
23 void func(S1<T, __builtin_ptrauth_type_discriminator(T)> s1) { // expected-error {{cannot yet mangle __builtin_ptrauth_type_discriminator expression}}
24 }
25
26 void testfunc1() {
27 func(S1<int(), __builtin_ptrauth_type_discriminator(int())>());
28 }
29
30 // FIXME: There are several more cases we can't yet mangle.
31
32 #else
33 #error unknown N
34 #endif