Add additional test cases for #1209

These test cases don't use dynamic labels.
https://github.com/cc65/cc65/issues/1209#issuecomment-678738971

Also update the original test case for consistency:
* Change failure message to just "FAIL", as there is only one failure
* Outdent label definitions
* Clarify description
This commit is contained in:
Jesse Rosenstock
2020-08-23 21:50:54 +02:00
committed by Oliver Schmidt
parent d38e5858f0
commit 344aea0669
4 changed files with 121 additions and 3 deletions

View File

@@ -19,7 +19,7 @@
*/
/*
Tests of indirect goto with the label before the goto.
Test of indirect goto with dynamic labels and order label def, label ref, goto.
https://github.com/cc65/cc65/issues/1209
This should compile and should be moved to tests/val/ when the bug is fixed.
*/
@@ -32,7 +32,7 @@ int f (void)
{
static void *x[1];
/* Define the label before referencing it with indirect label syntax. */
L: if (x[0] != 0) return 0;
L: if (x[0] != 0) return 0;
x[0] = &&L;
goto *x[0];
}
@@ -46,7 +46,7 @@ int main (void)
if (failures == 0) {
printf ("PASS\n");
} else {
printf ("FAIL: %d failures\n", failures);
printf ("FAIL\n");
}
return failures;