blob: 02548964efc964bc491384a427e6e9d3ffaaa580 [file] [log] [blame]
Daniel Jaspera61e2122015-03-11 06:01:01 +00001// 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 %itanium_abi_triple -verify %s -DN=3
Richard Smithed1cb882015-03-11 00:12:17 +00004
5struct A { int a; };
6
7#if N == 1
8// ChooseExpr
9template<class T> void test(int (&)[sizeof(__builtin_choose_expr(true, 1, 1), T())]) {} // expected-error {{cannot yet mangle}}
10template void test<int>(int (&)[sizeof(int)]);
11
12#elif N == 2
13// CompoundLiteralExpr
14template<class T> void test(int (&)[sizeof((A){}, T())]) {} // expected-error {{cannot yet mangle}}
15template void test<int>(int (&)[sizeof(A)]);
16
17#elif N == 3
18// DesignatedInitExpr
19template<class T> void test(int (&)[sizeof(A{.a = 10}, T())]) {} // expected-error {{cannot yet mangle}}
20template void test<int>(int (&)[sizeof(A)]);
21
22// FIXME: There are several more cases we can't yet mangle.
23
24#else
25#error unknown N
26#endif