diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/lvalue-cast-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/lvalue-cast-2.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/lvalue-cast-2.c b/gcc/testsuite/gcc.dg/lvalue-cast-2.c new file mode 100644 index 00000000000..bfd2e29e52c --- /dev/null +++ b/gcc/testsuite/gcc.dg/lvalue-cast-2.c @@ -0,0 +1,14 @@ +/* APPLE LOCAL file non lvalue assign */ +/* Allow lvalue casts in conjunction with '&'. */ +/* { dg-do compile } */ +/* { dg-options "-fnon-lvalue-assign" } */ + +int foo (void **ptr) { + return 1; +} + +int bar (void) { + char *string; + + return foo ((void **)&((char *)string)); /* { dg-warning "argument to .&. not really an lvalue" } */ +} |