| 1 |
/* Test for constraints on return statements. */ |
| 2 |
/* Origin: Joseph Myers <[email protected]> */ |
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ |
| 5 |
|
| 6 |
int |
| 7 |
foo (void) |
| 8 |
{ |
| 9 |
return; /* { dg-bogus "warning" "warning in place of error" } */ |
| 10 |
/* { dg-error "with no value" "return constraint violation" { target *-*-* } .-1 } */ |
| 11 |
} |
| 12 |
|
| 13 |
void |
| 14 |
bar (void) |
| 15 |
{ |
| 16 |
return 1; /* { dg-bogus "warning" "warning in place of error" } */ |
| 17 |
/* { dg-error "with a value" "return constraint violation" { target *-*-* } .-1 } */ |
| 18 |
} |