brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · a2fd16b Raw
36 lines · cpp
1// RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=12// RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=23// RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple arm64-apple-ios -fptrauth-intrinsics -verify %s -DN=34// RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple aarch64-linux-gnu -fptrauth-intrinsics -verify %s -DN=35 6struct A { int a; };7 8#if N == 19// ChooseExpr10template<class T> void test(int (&)[sizeof(__builtin_choose_expr(true, 1, 1), T())]) {} // expected-error {{cannot yet mangle}}11template void test<int>(int (&)[sizeof(int)]);12 13#elif N == 214// CompoundLiteralExpr15template<class T> void test(int (&)[sizeof((A){}, T())]) {} // expected-error {{cannot yet mangle}}16template void test<int>(int (&)[sizeof(A)]);17 18#elif N == 319// __builtin_ptrauth_type_discriminator20template <class T, unsigned disc>21struct S1 {};22 23template<class T>24void func(S1<T, __builtin_ptrauth_type_discriminator(T)> s1) { // expected-error {{cannot yet mangle __builtin_ptrauth_type_discriminator expression}}25}26 27void testfunc1() {28  func(S1<int(), __builtin_ptrauth_type_discriminator(int())>());29}30 31// FIXME: There are several more cases we can't yet mangle.32 33#else34#error unknown N35#endif36