| 1 |
// REQUIRED_ARGS: -o- |
| 2 |
// PERMUTE_ARGS: |
| 3 |
/* |
| 4 |
TEST_OUTPUT: |
| 5 |
--- |
| 6 |
123 |
| 7 |
123u |
| 8 |
123L |
| 9 |
123LU |
| 10 |
123.5 |
| 11 |
123.5F |
| 12 |
123.5L |
| 13 |
123.5i |
| 14 |
123.5Fi |
| 15 |
123.5Li |
| 16 |
(123.5+5.5i) |
| 17 |
(123.5F+5.5Fi) |
| 18 |
(123.5L+5.5Li) |
| 19 |
--- |
| 20 |
*/ |
| 21 |
pragma(msg, 123); |
| 22 |
pragma(msg, 123u); |
| 23 |
pragma(msg, 123L); |
| 24 |
pragma(msg, 123uL); |
| 25 |
pragma(msg, 123.5); |
| 26 |
pragma(msg, 123.5f); |
| 27 |
pragma(msg, 123.5L); |
| 28 |
pragma(msg, 123.5i); |
| 29 |
pragma(msg, 123.5fi); |
| 30 |
pragma(msg, 123.5Li); |
| 31 |
pragma(msg, 123.5 +5.5i); |
| 32 |
pragma(msg, 123.5f+5.5fi); |
| 33 |
pragma(msg, 123.5L+5.5Li); |
| 34 |
|
| 35 |
static assert((123 ).stringof == "123"); |
| 36 |
static assert((123u ).stringof == "123u"); |
| 37 |
static assert((123L ).stringof == "123L"); |
| 38 |
static assert((123uL).stringof == "123LU"); |
| 39 |
version (GNU) |
| 40 |
{ |
| 41 |
static assert((123.5 ).stringof == "1.235e+2"); |
| 42 |
static assert((123.5f ).stringof == "1.235e+2F"); |
| 43 |
static assert((123.5L ).stringof == "1.235e+2L"); |
| 44 |
static assert((123.5i ).stringof == "1.235e+2i"); |
| 45 |
static assert((123.5fi).stringof == "1.235e+2Fi"); |
| 46 |
static assert((123.5Li).stringof == "1.235e+2Li"); |
| 47 |
static assert((123.5 +5.5i ).stringof == "1.235e+2 + 5.5e+0i"); |
| 48 |
static assert((123.5f+5.5fi).stringof == "1.235e+2F + 5.5e+0Fi"); |
| 49 |
static assert((123.5L+5.5Li).stringof == "1.235e+2L + 5.5e+0Li"); |
| 50 |
} |
| 51 |
else |
| 52 |
{ |
| 53 |
static assert((123.5 ).stringof == "123.5"); |
| 54 |
static assert((123.5f ).stringof == "123.5F"); |
| 55 |
static assert((123.5L ).stringof == "123.5L"); |
| 56 |
static assert((123.5i ).stringof == "123.5i"); |
| 57 |
static assert((123.5fi).stringof == "123.5Fi"); |
| 58 |
static assert((123.5Li).stringof == "123.5Li"); |
| 59 |
static assert((123.5 +5.5i ).stringof == "123.5 + 5.5i"); |
| 60 |
static assert((123.5f+5.5fi).stringof == "123.5F + 5.5Fi"); |
| 61 |
static assert((123.5L+5.5Li).stringof == "123.5L + 5.5Li"); |
| 62 |
} |