diff options
author | Steve Naroff <snaroff@apple.com> | 2008-02-29 23:30:25 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-02-29 23:30:25 +0000 |
commit | b96e4ab649b3febe8b5e223806eaa9eb6e585179 (patch) | |
tree | 1872838aa940297551aaf14f40cbbca99fb96765 /clang/test/Sema/expr-address-of.c | |
parent | 6f5fca78e4fccfeeb8f2de0386badb60a8333794 (diff) | |
download | bcm5719-llvm-b96e4ab649b3febe8b5e223806eaa9eb6e585179.tar.gz bcm5719-llvm-b96e4ab649b3febe8b5e223806eaa9eb6e585179.zip |
Fix http://llvm.org/bugs/show_bug.cgi?id=2103.
llvm-svn: 47775
Diffstat (limited to 'clang/test/Sema/expr-address-of.c')
-rw-r--r-- | clang/test/Sema/expr-address-of.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/test/Sema/expr-address-of.c b/clang/test/Sema/expr-address-of.c index 5f46b630467..46ba5dae4dd 100644 --- a/clang/test/Sema/expr-address-of.c +++ b/clang/test/Sema/expr-address-of.c @@ -1,10 +1,18 @@ // RUN: clang %s -verify -fsyntax-only -struct entry { int value; }; +struct xx { int bitf:1; }; + +struct entry { struct xx *whatever; + int value; + int bitf:1; }; void add_one(int *p) { (*p)++; } void test() { register struct entry *p; add_one(&p->value); + struct entry pvalue; + add_one(&p->bitf); // expected-error {{address of bit-field requested}} + add_one(&pvalue.bitf); // expected-error {{address of bit-field requested}} + add_one(&p->whatever->bitf); // expected-error {{address of bit-field requested}} } void foo() { @@ -17,4 +25,9 @@ void foo() { int *x3 = &y[10]; } +void testVectorComponentAccess() { + typedef float v4sf __attribute__ ((vector_size (16))); + static v4sf q; + float* r = &q[0]; // expected-error {{address of vector requested}} +} |