diff options
author | Nate Begeman <natebegeman@mac.com> | 2009-02-15 22:45:20 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2009-02-15 22:45:20 +0000 |
commit | a6b47a41429fb9bc7e8dcacc014dac37d5759a02 (patch) | |
tree | e9127d85ece7201b8ca65f22baf0d6acce9e0e55 /clang/test/Sema/expr-address-of.c | |
parent | 4576b2eebdba83c913166e8e26ba4310ee442f45 (diff) | |
download | bcm5719-llvm-a6b47a41429fb9bc7e8dcacc014dac37d5759a02.tar.gz bcm5719-llvm-a6b47a41429fb9bc7e8dcacc014dac37d5759a02.zip |
Don't allow taking the address of an element in an ext_vector
llvm-svn: 64614
Diffstat (limited to 'clang/test/Sema/expr-address-of.c')
-rw-r--r-- | clang/test/Sema/expr-address-of.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; |