From a6b47a41429fb9bc7e8dcacc014dac37d5759a02 Mon Sep 17 00:00:00 2001 From: Nate Begeman Date: Sun, 15 Feb 2009 22:45:20 +0000 Subject: Don't allow taking the address of an element in an ext_vector llvm-svn: 64614 --- clang/test/Sema/expr-address-of.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'clang/test/Sema/expr-address-of.c') diff --git a/clang/test/Sema/expr-address-of.c b/clang/test/Sema/expr-address-of.c index 58bc540a30d..7dd7dd67d37 100644 --- a/clang/test/Sema/expr-address-of.c +++ b/clang/test/Sema/expr-address-of.c @@ -28,9 +28,14 @@ void foo() { void testVectorComponentAccess() { typedef float v4sf __attribute__ ((vector_size (16))); static v4sf q; - float* r = &q[0]; // expected-error {{address of vector requested}} + float* r = &q[0]; // expected-error {{address of vector element requested}} } +typedef __attribute__(( ext_vector_type(4) )) float float4; + +float *testExtVectorComponentAccess(float4 x) { + return &x.w; // expected-error {{address of vector element requested}} +} void f0() { register int *x0; -- cgit v1.2.3