Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/c-c++-common/tsan/pr81275.c @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line source
/* PR sanitizer/81275 */ /* { dg-do compile } */ /* { dg-options "-Wreturn-type -fsanitize=thread" } */ int f1 (int a, int b) { switch (a) { case 0: switch (b) { case 5: return 6; case 7: return 8; default: return 0; } break; default: return 0; } } /* { dg-bogus "control reaches end of non-void function" } */ int f2 (int a, int b) { switch (a) { case 0: switch (b) { case 5: return 6; case 7: return 8; default: return 0; } default: return 0; } } /* { dg-bogus "control reaches end of non-void function" } */ int f3 (int a, int b) { switch (a) { case 0: switch (b) { case 5: return 6; case 7: return 8; case 8: break; default: return 0; } break; default: return 0; } } /* { dg-warning "control reaches end of non-void function" } */ int f4 (int a, int b) { switch (a) { case 0: switch (b) { case 5: return 6; case 7: return 8; } break; default: return 0; } } /* { dg-warning "control reaches end of non-void function" } */ int f5 (int a, unsigned char b) { switch (a) { case 0: switch (b) { case 0: return 1; case 3 ... 10: return 2; case 1 ... 2: return 3; case 126 ... (unsigned char) ~0: return 4; case 11 ... 125: return 5; } break; default: return 0; } } /* { dg-bogus "control reaches end of non-void function" } */