aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/expr-address-of.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/expr-address-of.c')
-rw-r--r--test/Sema/expr-address-of.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Sema/expr-address-of.c b/test/Sema/expr-address-of.c
new file mode 100644
index 0000000000..f085b6012a
--- /dev/null
+++ b/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}}
+}
+
+