X-Git-Url: https://pd.if.org/git/?p=lice;a=blobdiff_plain;f=tests%2Fes.c;fp=tests%2Fes.c;h=c27c2818c1b1f34709dd3f1e25212c3d242dece3;hp=0000000000000000000000000000000000000000;hb=f1abb26903687c7967cf37c3f6c830051bdeb371;hpb=bb650f4a52a456c1aa0a34508d6f3dcce58291b6 diff --git a/tests/es.c b/tests/es.c new file mode 100644 index 0000000..c27c281 --- /dev/null +++ b/tests/es.c @@ -0,0 +1,31 @@ +// expression statements + +#define maxint(A, B) \ + ({ int a = (A), b = (B); a > b ? a : b; }) + +int main(void) { + + expecti(({ 'a'; 1; 64; }), 64); + + expecti( + ({ + int a = 10; + a; + }), 10 + ); + + expecti( + ({ + int i = 0; + for (; i < 10; i++) + ; + i; + }), 10 + ); + + expecti(maxint(100, 5), 100); + + expecti(({ (int){1}; }), 1); + + return 0; +}