mirror of
https://github.com/mirror/tinycc.git
synced 2024-12-28 04:00:06 +08:00
19e3e10e4b
tccgen.c: - just track local_stack for small scopes (can't declare variables) - fix a vla problem with nested scopes - move debug N_L/RBRAC into curly braced block Also: - tccpp.c: move 'label_...' functions to tccgen.c - tccpp.c: let get_tok_str() say "<no name>" for anonymous symbols - tcctest.c: let __pa_symbol() work for memory > 2GB - 119_random_stuff.c: revert strtoll test (no reason to test libc) - tccdefs.h/tcctest.c: enable bit fncs for _WIN32 - Makefile: - use i686-linux-gnu instead of i386-linux-gnu for cross-i386 - update 'make help' - revert umplicit 'make all' with 'make install' (but print warning)
44 lines
981 B
C
44 lines
981 B
C
#include <stdio.h>
|
|
enum{ in = 0};
|
|
#define myassert(X) do{ if(!X) printf("%d: assertion failed\n", __LINE__); }while(0)
|
|
int main(){
|
|
{
|
|
myassert(!in);
|
|
if(sizeof(enum{in=1})) myassert(in);
|
|
myassert(!in); //OOPS
|
|
}
|
|
{
|
|
myassert(!in);
|
|
switch(sizeof(enum{in=1})) { default: myassert(in); }
|
|
myassert(!in); //OOPS
|
|
}
|
|
{
|
|
myassert(!in);
|
|
while(sizeof(enum{in=1})) { myassert(in); break; }
|
|
myassert(!in); //OOPS
|
|
}
|
|
{
|
|
myassert(!in);
|
|
do{ myassert(!in);}while(0*sizeof(enum{in=1}));
|
|
myassert(!in); //OOPS
|
|
}
|
|
|
|
{
|
|
myassert(!in);
|
|
for(sizeof(enum{in=1});;){ myassert(in); break; }
|
|
myassert(!in); //OK
|
|
}
|
|
{
|
|
myassert(!in);
|
|
for(;;sizeof(enum{in=1})){ myassert(in); break; }
|
|
myassert(!in); //OK
|
|
}
|
|
{
|
|
myassert(!in);
|
|
for(;sizeof(enum{in=1});){ myassert(in); break; }
|
|
myassert(!in); //OK
|
|
}
|
|
|
|
}
|
|
|