diff options
Diffstat (limited to 'clang/test/Sema/expr-address-of.c')
-rw-r--r-- | clang/test/Sema/expr-address-of.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/Sema/expr-address-of.c b/clang/test/Sema/expr-address-of.c new file mode 100644 index 00000000000..f085b6012a0 --- /dev/null +++ b/clang/test/Sema/expr-address-of.c @@ -0,0 +1,15 @@ +// RUN: clang %s -verify -fsyntax-only +struct entry { int value; }; +void add_one(int *p) { (*p)++; } + +void test() { + register struct entry *p; + add_one(&p->value); +} + +void foo() { + register int x[10]; + &x[10]; // expected-error {{address of register variable requested}} +} + + |