Added tests for issue #191.
git-svn-id: http://picoc.googlecode.com/svn/trunk@607 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
864c372dbb
commit
f41a1c5f51
34
tests/68_return.c
Normal file
34
tests/68_return.c
Normal file
|
@ -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
tests/68_return.expect
Normal file
2
tests/68_return.expect
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Here's a print statement before quitting.
|
||||||
|
returning; there should be no further output.
|
|
@ -61,6 +61,7 @@ TESTS= 00_assignment.test \
|
||||||
64_double_prefix_op.test \
|
64_double_prefix_op.test \
|
||||||
66_printf_undefined.test \
|
66_printf_undefined.test \
|
||||||
67_macro_crash.test \
|
67_macro_crash.test \
|
||||||
|
68_return.test \
|
||||||
|
|
||||||
|
|
||||||
include csmith/Makefile
|
include csmith/Makefile
|
||||||
|
|
Loading…
Reference in a new issue