| ... | @@ -1425,6 +1425,48 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -1425,6 +1425,48 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 1425 | \\pub export fn bar() void {} | 1425 | \\pub export fn bar() void {} |
| 1426 | ); | 1426 | ); |
| 1427 | | 1427 | |
| | 1428 | cases.addC("u integer suffix after 0 (zero) in macro definition", |
| | 1429 | "#define ZERO 0U" |
| | 1430 | , |
| | 1431 | "pub const ZERO = c_uint(0);" |
| | 1432 | ); |
| | 1433 | |
| | 1434 | cases.addC("l integer suffix after 0 (zero) in macro definition", |
| | 1435 | "#define ZERO 0L" |
| | 1436 | , |
| | 1437 | "pub const ZERO = c_long(0);" |
| | 1438 | ); |
| | 1439 | |
| | 1440 | cases.addC("ul integer suffix after 0 (zero) in macro definition", |
| | 1441 | "#define ZERO 0UL" |
| | 1442 | , |
| | 1443 | "pub const ZERO = c_ulong(0);" |
| | 1444 | ); |
| | 1445 | |
| | 1446 | cases.addC("lu integer suffix after 0 (zero) in macro definition", |
| | 1447 | "#define ZERO 0LU" |
| | 1448 | , |
| | 1449 | "pub const ZERO = c_ulong(0);" |
| | 1450 | ); |
| | 1451 | |
| | 1452 | cases.addC("ll integer suffix after 0 (zero) in macro definition", |
| | 1453 | "#define ZERO 0LL" |
| | 1454 | , |
| | 1455 | "pub const ZERO = c_longlong(0);" |
| | 1456 | ); |
| | 1457 | |
| | 1458 | cases.addC("ull integer suffix after 0 (zero) in macro definition", |
| | 1459 | "#define ZERO 0ULL" |
| | 1460 | , |
| | 1461 | "pub const ZERO = c_ulonglong(0);" |
| | 1462 | ); |
| | 1463 | |
| | 1464 | cases.addC("llu integer suffix after 0 (zero) in macro definition", |
| | 1465 | "#define ZERO 0LLU" |
| | 1466 | , |
| | 1467 | "pub const ZERO = c_ulonglong(0);" |
| | 1468 | ); |
| | 1469 | |
| 1428 | // cases.add("empty array with initializer", | 1470 | // cases.add("empty array with initializer", |
| 1429 | // "int a[4] = {};" | 1471 | // "int a[4] = {};" |
| 1430 | // , | 1472 | // , |