// RUN: %clang_cc1 -emit-llvm -x c++ -std=c++11 -verify %s -DN=1
// RUN: %clang_cc1 -emit-llvm -x c++ -std=c++11 -verify %s -DN=2
// RUN: %clang_cc1 -emit-llvm -x c++ -std=c++11 -verify %s -DN=3

struct A { int a; };

#if N == 1
// ChooseExpr
template<class T> void test(int (&)[sizeof(__builtin_choose_expr(true, 1, 1), T())]) {} // expected-error {{cannot yet mangle}}
template void test<int>(int (&)[sizeof(int)]);

#elif N == 2
// CompoundLiteralExpr
template<class T> void test(int (&)[sizeof((A){}, T())]) {} // expected-error {{cannot yet mangle}}
template void test<int>(int (&)[sizeof(A)]);

#elif N == 3
// DesignatedInitExpr
template<class T> void test(int (&)[sizeof(A{.a = 10}, T())]) {} // expected-error {{cannot yet mangle}}
template void test<int>(int (&)[sizeof(A)]);

// FIXME: There are several more cases we can't yet mangle.

#else
#error unknown N
#endif

// RUN: %clang_cc1 -emit-llvm -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=1
// RUN: %clang_cc1 -emit-llvm -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=2
// RUN: %clang_cc1 -emit-llvm -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=3

struct A { int a; };

#if N == 1
// ChooseExpr
template<class T> void test(int (&)[sizeof(__builtin_choose_expr(true, 1, 1), T())]) {} // expected-error {{cannot yet mangle}}
template void test<int>(int (&)[sizeof(int)]);

#elif N == 2
// CompoundLiteralExpr
template<class T> void test(int (&)[sizeof((A){}, T())]) {} // expected-error {{cannot yet mangle}}
template void test<int>(int (&)[sizeof(A)]);

#elif N == 3
// DesignatedInitExpr
template<class T> void test(int (&)[sizeof(A{.a = 10}, T())]) {} // expected-error {{cannot yet mangle}}
template void test<int>(int (&)[sizeof(A)]);

// FIXME: There are several more cases we can't yet mangle.

#else
#error unknown N
#endif

Fix test to specify an Itanium triple.
Fix test to specify an Itanium triple.


git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@231900 91177308-0d34-0410-b5e6-96231b3b80d8
