Debian Codegraph @

gcc/testsuite/gdc.test/compilable/testdefines.d

raw
1 // EXTRA_FILES: imports/defines.c
2 import imports.defines;
3
4 static assert(CC == 'c');
5 static assert(I32 == 3);
6 static assert(U32 == 4);
7 static assert(I64 == 5);
8 static assert(U64 == 6);
9
10 static assert(F32 == 7.0f);
11 static assert(F64 == 8.0);
12 static assert(F80 == 9.0L);
13
14 static assert(SSS == "hello");
15
16 static assert(ABC == 12);
17 static assert(DEF == 17);
18
19 static assert(ADD(3, 4) == 7);
20 static assert(SUB() == 1);
21
22 static assert(pr16199_skipped1(5) == 1);
23 static assert(pr16199_skipped2(6) == 2);
24 static assert(pr16199_ice == 3);
25
26 static assert(pr16199d() == 7);
27 static assert(pr16199c() == 8);
28
29 // https://issues.dlang.org/show_bug.cgi?id=24639
30 static assert(NEGATIVE_I32 == -1);
31 static assert(NEGATIVE_U32 == cast(uint)-2);
32 static assert(NEGATIVE_I64 == -3);
33 static assert(NEGATIVE_U64 == cast(ulong)-4L);
34 static assert(NEGATIVE_F32 == -5f);
35 static assert(NEGATIVE_F64 == -6);
36 static assert(is(typeof(NEGATIVE_I32) == int));
37 static assert(is(typeof(NEGATIVE_U32) == uint));
38 static assert(is(typeof(NEGATIVE_I64) == long));
39 static assert(is(typeof(NEGATIVE_U64) == ulong));
40 static assert(is(typeof(NEGATIVE_F32) == float));
41 static assert(is(typeof(NEGATIVE_F64) == double));