Debian Codegraph @

src/test/01-Basic/122.ck

raw
1 // negative array index access tests
2 [1,2,3,4] @=> int a[];
3
4 // failure cases
5 if( a[-1] != 4 ) <<< "FAILURE, expecting 4" >>>;
6 if( a[-4] != 1 ) <<< "FAILURE, expecting 1" >>>;
7
8 // should generate a array out of bounds
9 a[-5];