scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit fbc4a2c2bfb90654aafbdaf3c3e2a76b807ea19b
parent 4ef8edb2ea08f08fcaf8056909d014ccae1e6455
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue,  6 Oct 2015 15:21:30 +0200

Add basic test for enumerations

Diffstat:
cc1/tests/test035.c | 30++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+), 0 deletions(-)

diff --git a/cc1/tests/test035.c b/cc1/tests/test035.c @@ -0,0 +1,30 @@ + +/* +name: TEST035 +description: Basic test for enumerations +output: + +*/ + +enum E { + x, + y = 2, + z, +}; + + +int +main() +{ + enum E e; + + if(x != 0) + return 1; + if(y != 2) + return 2; + if(z != 3) + return 3; + + e = x; + return x; +}