PR middle-end/18160
* g++.dg/warn/register-var-1.C: New test.
* g++.dg/warn/register-var-2.C: New test.
From-SVN: r90453
+2004-11-10 Adam Nemet <anemet@lnxw.com>
+
+ PR middle-end/18160
+ * g++.dg/warn/register-var-1.C: New test.
+ * g++.dg/warn/register-var-2.C: New test.
+
2004-11-10 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/union-2.c: New test.
--- /dev/null
+/* PR/18160 */
+
+/* { dg-do compile { target i?86-*-* } } */
+
+/* This should yield an error even without -pedantic. */
+/* { dg-options "-ansi" } */
+
+void g(int *);
+
+void f(void)
+{
+ register int x __asm ("eax");
+ g(&x); /* { dg-error "error: address of explicit register variable" } */
+}
--- /dev/null
+/* PR/18160 */
+
+/* { dg-do compile } */
+
+/* This should yield an error even without -pedantic. */
+/* { dg-options "-Wall -W" } */
+
+void g(int *);
+
+void f(void)
+{
+ register int x;
+ g(&x); /* { dg-warning "address requested for 'x', which is declared 'register'" } */
+}