gcc/testsuite/g++.old-deja/g++.ext/namedret3.C
raw| 1 | // { dg-do assemble } |
| 2 | // { dg-options "-Wno-deprecated -Wno-return-type" } |
| 3 | |
| 4 | extern "C" void abort(); |
| 5 | |
| 6 | int f2(int *x) |
| 7 | { |
| 8 | *x = 1; |
| 9 | return 2; |
| 10 | } |
| 11 | |
| 12 | int f1() return x // { dg-error "" } |
| 13 | { |
| 14 | f2(&x); // { dg-error "" } |
| 15 | } |
| 16 | |
| 17 | void g() |
| 18 | { |
| 19 | int scratch[100]; |
| 20 | int i; |
| 21 | for (i = 0; i < 100; ++i) |
| 22 | scratch[i] = 0; |
| 23 | } |
| 24 | |
| 25 | int main() |
| 26 | { |
| 27 | g(); |
| 28 | if (f1() != 1) |
| 29 | abort (); |
| 30 | return 0; |
| 31 | } |