From 180abc3db9ae3b4fc63cd65b15697e6ffcc8a657 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 17 Jul 2011 15:40:56 +0000 Subject: Vendor import of clang trunk r135360: http://llvm.org/svn/llvm-project/cfe/trunk@135360 --- test/SemaTemplate/ext-vector-type.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'test/SemaTemplate/ext-vector-type.cpp') diff --git a/test/SemaTemplate/ext-vector-type.cpp b/test/SemaTemplate/ext-vector-type.cpp index 7334e88e9267d..f968c13f10238 100644 --- a/test/SemaTemplate/ext-vector-type.cpp +++ b/test/SemaTemplate/ext-vector-type.cpp @@ -58,3 +58,37 @@ int test_make6() { y.x = -1; y.w = -1; // expected-error{{vector component access exceeds type}} } + +namespace Deduction { + template struct X0; + + template + struct X0 { + static const unsigned value = 0; + }; + + template + struct X0 { + static const unsigned value = 1; + }; + + template + struct X0 { + static const unsigned value = 2; + }; + + template<> + struct X0 { + static const unsigned value = 3; + }; + + typedef int __attribute__((ext_vector_type(2))) int2; + typedef int __attribute__((ext_vector_type(4))) int4; + typedef float __attribute__((ext_vector_type(2))) float2; + typedef float __attribute__((ext_vector_type(4))) float4; + + int array0[X0::value == 0? 1 : -1]; + int array1[X0::value == 1? 1 : -1]; + int array2[X0::value == 2? 1 : -1]; + int array3[X0::value == 3? 1 : -1]; +} -- cgit v1.3