Add tests for binary integer literal constants

This commit is contained in:
Olly Betts 2022-07-25 18:17:04 +12:00
parent 1bfe88eeda
commit c759da250f
2 changed files with 13 additions and 0 deletions

View File

@ -10,4 +10,8 @@ int b2 = 0b10;
long b3 = 0b11l;
unsigned long b4 = 0b100ul;
unsigned long b5 = 0B101UL;
#define b6 0b110
const int b7 = 0b111;
%}
%constant int b8 = 0b1000;

View File

@ -14,3 +14,12 @@ if cvar.b4 != 4:
if cvar.b5 != 5:
raise RuntimeError
if b6 != 6:
raise RuntimeError
if b7 != 7:
raise RuntimeError
if b8 != 8:
raise RuntimeError