xref: /aosp_15_r20/external/clang/test/CodeGenCXX/mangle-fail.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=1
2*67e74705SXin Li // RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=2
3*67e74705SXin Li // RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=3
4*67e74705SXin Li 
5*67e74705SXin Li struct A { int a; };
6*67e74705SXin Li 
7*67e74705SXin Li #if N == 1
8*67e74705SXin Li // ChooseExpr
test(int (&)[sizeof (__builtin_choose_expr (true,1,1),T ())])9*67e74705SXin Li template<class T> void test(int (&)[sizeof(__builtin_choose_expr(true, 1, 1), T())]) {} // expected-error {{cannot yet mangle}}
10*67e74705SXin Li template void test<int>(int (&)[sizeof(int)]);
11*67e74705SXin Li 
12*67e74705SXin Li #elif N == 2
13*67e74705SXin Li // CompoundLiteralExpr
test(int (&)[sizeof ((A){},T ())])14*67e74705SXin Li template<class T> void test(int (&)[sizeof((A){}, T())]) {} // expected-error {{cannot yet mangle}}
15*67e74705SXin Li template void test<int>(int (&)[sizeof(A)]);
16*67e74705SXin Li 
17*67e74705SXin Li #elif N == 3
18*67e74705SXin Li // DesignatedInitExpr
test(int (&)[sizeof (A{.a = 10},T ())])19*67e74705SXin Li template<class T> void test(int (&)[sizeof(A{.a = 10}, T())]) {} // expected-error {{cannot yet mangle}}
20*67e74705SXin Li template void test<int>(int (&)[sizeof(A)]);
21*67e74705SXin Li 
22*67e74705SXin Li // FIXME: There are several more cases we can't yet mangle.
23*67e74705SXin Li 
24*67e74705SXin Li #else
25*67e74705SXin Li #error unknown N
26*67e74705SXin Li #endif
27