From: Michael Beck Date: Mon, 1 Sep 2008 00:01:55 +0000 (+0000) Subject: test for computed goto X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=44041e201dc1fffa099448d5460855f44e834900;hp=69fead3484c9ad315f526554c0efb949c7c1c67e;p=cparser test for computed goto [r21608] --- diff --git a/parsetest/gnu99/computed_goto.c b/parsetest/gnu99/computed_goto.c new file mode 100644 index 0000000..f266b93 --- /dev/null +++ b/parsetest/gnu99/computed_goto.c @@ -0,0 +1,12 @@ +int test(int x) { + static void *array[] = { &&foo, &&bar, &&hack }; + + goto *array[x]; +foo: return 1; +bar: return 2; +hack: return 3; +} + +int main(int argc, char *argv[]) { + return test(1) == 2 ? 0 : 1; +}