gcc/testsuite/gcc.c-torture/execute/920501-4.c
raw| 1 | /* { dg-require-effective-target label_values } */ |
| 2 | |
| 3 | void abort (void); |
| 4 | void exit (int); |
| 5 | |
| 6 | int |
| 7 | x (int i) |
| 8 | { |
| 9 | static const void *j[] = {&& x, && y, && z}; |
| 10 | |
| 11 | goto *j[i]; |
| 12 | |
| 13 | x: return 2; |
| 14 | y: return 3; |
| 15 | z: return 5; |
| 16 | } |
| 17 | |
| 18 | int |
| 19 | main (void) |
| 20 | { |
| 21 | if ( x (0) != 2 |
| 22 | || x (1) != 3 |
| 23 | || x (2) != 5) |
| 24 | abort (); |
| 25 | |
| 26 | exit (0); |
| 27 | } |