Skip to content

Commit

Permalink
Added tests for issue #191.
Browse files Browse the repository at this point in the history
  • Loading branch information
zik.saleeba committed Mar 1, 2014
1 parent f006d6c commit 18fb350
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/68_return.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include <stdio.h>

void demo_error()
{
int value = 5;

printf("Here's a print statement before quitting.\n");

if(1) {
printf("returning; there should be no further output.\n");
return;
}

printf("This statement should not print, and does not.\n");

switch(value)
{
case 5:
printf("case 5: value = %d\n", value);
break;
case 0:
printf("case 0: value=%d\n", value);
break;
}

printf("This statement also should not and does not print.\n");

return;
}

void main()
{
demo_error();
}
2 changes: 2 additions & 0 deletions tests/68_return.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Here's a print statement before quitting.
returning; there should be no further output.
1 change: 1 addition & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ TESTS= 00_assignment.test \
64_double_prefix_op.test \
66_printf_undefined.test \
67_macro_crash.test \
68_return.test \


include csmith/Makefile
Expand Down

0 comments on commit 18fb350

Please sign in to comment.