expr-address-of.c revision 369dee454fe7e77720d0d0012a23b75e17bee101
1// RUN: clang %s -verify -fsyntax-only
2struct entry { int value; };
3void add_one(int *p) { (*p)++; }
4
5void test() {
6 register struct entry *p;
7 add_one(&p->value);
8}
9
10void foo() {
11  register int x[10];
12  &x[10];              // expected-error {{address of register variable requested}}
13
14  register int *y;
15
16  int *x2 = &y; // expected-error {{address of register variable requested}}
17  int *x3 = &y[10];
18}
19
20
21