Fix http://llvm.org/bugs/show_bug.cgi?id=2103.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47775 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/expr-address-of.c b/test/Sema/expr-address-of.c
index 5f46b63..46ba5da 100644
--- a/test/Sema/expr-address-of.c
+++ b/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 @@
   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}}
+}