picoc/tests/50_logical_second_arg.c
zik.saleeba bd601e45c3 Structure element access wasn't obeying precedence rules. It is now.
Fixed test case 50.

git-svn-id: http://picoc.googlecode.com/svn/trunk@545 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-16 04:46:04 +00:00

28 lines
503 B
C

#include <stdio.h>
int fred()
{
printf("fred\n");
return 0;
}
int joe()
{
printf("joe\n");
return 1;
}
int main()
{
printf("%d\n", fred() && joe());
printf("%d\n", fred() || joe());
printf("%d\n", joe() && fred());
printf("%d\n", joe() || fred());
printf("%d\n", fred() && (1 + joe()));
printf("%d\n", fred() || (0 + joe()));
printf("%d\n", joe() && (0 + fred()));
printf("%d\n", joe() || (1 + fred()));
return 0;
}