[73abe95] | 1 | // |
---|
[cd218e8] | 2 | // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo |
---|
| 3 | // |
---|
| 4 | // The contents of this file are covered under the licence agreement in the |
---|
| 5 | // file "LICENCE" distributed with Cforall. |
---|
[73abe95] | 6 | // |
---|
[dc8511c] | 7 | // literals.cfa -- |
---|
[73abe95] | 8 | // |
---|
[cd218e8] | 9 | // Author : Peter A. Buhr |
---|
| 10 | // Created On : Sat Sep 9 16:34:38 2017 |
---|
| 11 | // Last Modified By : Peter A. Buhr |
---|
[4b891e9] | 12 | // Last Modified On : Sat Jun 19 15:47:49 2021 |
---|
| 13 | // Update Count : 237 |
---|
[73abe95] | 14 | // |
---|
[cd218e8] | 15 | |
---|
[e782290] | 16 | #include <features.h> // __GNUC_PREREQ |
---|
[cd218e8] | 17 | #ifdef __CFA__ |
---|
[73abe95] | 18 | #include <fstream.hfa> |
---|
[cd218e8] | 19 | |
---|
[200fcb3] | 20 | void f( char v ) { sout | "char " | v; } |
---|
| 21 | void f( signed char v ) { sout | "signed char " | v; } |
---|
| 22 | void f( unsigned char v ) { sout | "unsigned char " | v; } |
---|
| 23 | void f( signed short v ) { sout | "signed short int" | v; } |
---|
| 24 | void f( unsigned short v ) { sout | "unsigned short int" | v; } |
---|
| 25 | void f( size_t v ) { sout | "size_t" | v; } |
---|
[cd218e8] | 26 | #endif // __CFA__ |
---|
| 27 | |
---|
| 28 | //#define ERROR |
---|
| 29 | |
---|
[62edde5] | 30 | int main() { |
---|
[cd218e8] | 31 | // integer literals |
---|
| 32 | |
---|
[ea46db7] | 33 | // binary |
---|
| 34 | 0b01101011; 0b01101011u; 0b01101011l; 0b01101011ll; 0b01101011ul; 0b01101011lu; 0b01101011ull; 0b01101011llu; |
---|
| 35 | +0b01101011; +0b01101011u; +0b01101011l; +0b01101011ll; +0b01101011ul; +0b01101011lu; +0b01101011ull; +0b01101011llu; |
---|
| 36 | -0b01101011; -0b01101011u; -0b01101011l; -0b01101011ll; -0b01101011ul; -0b01101011lu; -0b01101011ull; -0b01101011llu; |
---|
| 37 | |
---|
[cd218e8] | 38 | // octal |
---|
| 39 | 01234567; 01234567u; 01234567l; 01234567ll; 01234567ul; 01234567lu; 01234567ull; 01234567llu; |
---|
| 40 | +01234567; +01234567u; +01234567l; +01234567ll; +01234567ul; +01234567lu; +01234567ull; +01234567llu; |
---|
| 41 | -01234567; -01234567u; -01234567l; -01234567ll; -01234567ul; -01234567lu; -01234567ull; -01234567llu; |
---|
| 42 | |
---|
| 43 | // decimal |
---|
| 44 | 1234567890; 1234567890u; 1234567890l; 1234567890ll; 1234567890ul; 1234567890lu; 1234567890ull; 1234567890llu; |
---|
| 45 | +1234567890; +1234567890u; +1234567890l; +1234567890ll; +1234567890ul; +1234567890lu; +1234567890ull; +1234567890llu; |
---|
| 46 | -1234567890; -1234567890u; -1234567890l; -1234567890ll; -1234567890ul; -1234567890lu; -1234567890ull; -1234567890llu; |
---|
| 47 | |
---|
| 48 | // hexadecimal |
---|
| 49 | 0x0123456789abcdef; 0x0123456789abcdefu; 0x0123456789abcdefl; 0x0123456789abcdefll; 0x0123456789abcdeful; 0x0123456789abcdeflu; 0x0123456789abcdefull; 0x0123456789abcdefllu; |
---|
| 50 | +0x0123456789abcdef; +0x0123456789abcdefu; +0x0123456789abcdefl; +0x0123456789abcdefll; +0x0123456789abcdeful; +0x0123456789abcdeflu; +0x0123456789abcdefull; +0x0123456789abcdefllu; |
---|
| 51 | -0x0123456789abcdef; -0x0123456789abcdefu; -0x0123456789abcdefl; -0x0123456789abcdefll; -0x0123456789abcdeful; -0x0123456789abcdeflu; -0x0123456789abcdefull; -0x0123456789abcdefllu; |
---|
| 52 | |
---|
| 53 | 0x0123456789ABCDEF; 0x0123456789ABCDEFu; 0x0123456789ABCDEFl; 0x0123456789ABCDEFll; 0x0123456789ABCDEFul; 0x0123456789ABCDEFlu; 0x0123456789ABCDEFull; 0x0123456789ABCDEFllu; |
---|
| 54 | +0x0123456789ABCDEF; +0x0123456789ABCDEFu; +0x0123456789ABCDEFl; +0x0123456789ABCDEFll; +0x0123456789ABCDEFul; +0x0123456789ABCDEFlu; +0x0123456789ABCDEFull; +0x0123456789ABCDEFllu; |
---|
| 55 | -0x0123456789ABCDEF; -0x0123456789ABCDEFu; -0x0123456789ABCDEFl; -0x0123456789ABCDEFll; -0x0123456789ABCDEFul; -0x0123456789ABCDEFlu; -0x0123456789ABCDEFull; -0x0123456789ABCDEFllu; |
---|
| 56 | |
---|
| 57 | 0X0123456789abcdef; 0X0123456789abcdefu; 0X0123456789abcdefl; 0X0123456789abcdefll; 0X0123456789abcdeful; 0X0123456789abcdeflu; 0X0123456789abcdefull; 0X0123456789abcdefllu; |
---|
| 58 | +0X0123456789abcdef; +0X0123456789abcdefu; +0X0123456789abcdefl; +0X0123456789abcdefll; +0X0123456789abcdeful; +0X0123456789abcdeflu; +0X0123456789abcdefull; +0X0123456789abcdefllu; |
---|
| 59 | -0X0123456789abcdef; -0X0123456789abcdefu; -0X0123456789abcdefl; -0X0123456789abcdefll; -0X0123456789abcdeful; -0X0123456789abcdeflu; -0X0123456789abcdefull; -0X0123456789abcdefllu; |
---|
| 60 | |
---|
| 61 | 0X0123456789ABCDEF; 0X0123456789ABCDEFu; 0X0123456789ABCDEFl; 0X0123456789ABCDEFll; 0X0123456789ABCDEFul; 0X0123456789ABCDEFlu; 0X0123456789ABCDEFull; 0X0123456789ABCDEFllu; |
---|
| 62 | +0X0123456789ABCDEF; +0X0123456789ABCDEFu; +0X0123456789ABCDEFl; +0X0123456789ABCDEFll; +0X0123456789ABCDEFul; +0X0123456789ABCDEFlu; +0X0123456789ABCDEFull; +0X0123456789ABCDEFllu; |
---|
| 63 | -0X0123456789ABCDEF; -0X0123456789ABCDEFu; -0X0123456789ABCDEFl; -0X0123456789ABCDEFll; -0X0123456789ABCDEFul; -0X0123456789ABCDEFlu; -0X0123456789ABCDEFull; -0X0123456789ABCDEFllu; |
---|
| 64 | |
---|
[4b891e9] | 65 | // floating literals |
---|
| 66 | |
---|
| 67 | 0123456789.; 0123456789.f; 0123456789.d; 0123456789.l; 0123456789.F; 0123456789.D; 0123456789.L; |
---|
| 68 | +0123456789.; +0123456789.f; +0123456789.d; +0123456789.l; +0123456789.F; +0123456789.D; +0123456789.L; |
---|
| 69 | -0123456789.; -0123456789.f; -0123456789.d; -0123456789.l; -0123456789.F; -0123456789.D; -0123456789.L; |
---|
| 70 | |
---|
| 71 | 0123456789.e09; 0123456789.e09f; 0123456789.e09d; 0123456789.e09l; 0123456789.e09F; 0123456789.e09D; 0123456789.e09L; |
---|
| 72 | +0123456789.e09; +0123456789.e09f; +0123456789.e09d; +0123456789.e09l; +0123456789.e09F; +0123456789.e09D; +0123456789.e09L; |
---|
| 73 | -0123456789.e09; -0123456789.e09f; -0123456789.e09d; -0123456789.e09l; -0123456789.e09F; -0123456789.e09D; -0123456789.e09L; |
---|
| 74 | |
---|
| 75 | 0123456789.e+09; 0123456789.e+09f; 0123456789.e+09d; 0123456789.e+09l; 0123456789.e+09F; 0123456789.e+09D; 0123456789.e+09L; |
---|
| 76 | +0123456789.e+09; +0123456789.e+09f; +0123456789.e+09d; +0123456789.e+09l; +0123456789.e+09F; +0123456789.e+09D; +0123456789.e+09L; |
---|
| 77 | -0123456789.e+09; -0123456789.e+09f; -0123456789.e+09d; -0123456789.e+09l; -0123456789.e+09F; -0123456789.e+09D; -0123456789.e+09L; |
---|
| 78 | |
---|
| 79 | 0123456789.e-09; 0123456789.e-09f; 0123456789.e-09d; 0123456789.e-09l; 0123456789.e-09F; 0123456789.e-09D; 0123456789.e-09L; |
---|
| 80 | +0123456789.e-09; +0123456789.e-09f; +0123456789.e-09d; +0123456789.e-09l; +0123456789.e-09F; +0123456789.e-09D; +0123456789.e-09L; |
---|
| 81 | -0123456789.e-09; -0123456789.e-09f; -0123456789.e-09d; -0123456789.e-09l; -0123456789.e-09F; -0123456789.e-09D; -0123456789.e-09L; |
---|
| 82 | |
---|
| 83 | .0123456789; .0123456789f; .0123456789d; .0123456789l; .0123456789F; .0123456789D; .0123456789L; |
---|
| 84 | +.0123456789; +.0123456789f; +.0123456789d; +.0123456789l; +.0123456789F; +.0123456789D; +.0123456789L; |
---|
| 85 | -.0123456789; -.0123456789f; -.0123456789d; -.0123456789l; -.0123456789F; -.0123456789D; -.0123456789L; |
---|
| 86 | |
---|
| 87 | .0123456789e09; .0123456789e09f; .0123456789e09d; .0123456789e09l; .0123456789e09F; .0123456789e09D; .0123456789e09L; |
---|
| 88 | +.0123456789e09; +.0123456789e09f; +.0123456789e09d; +.0123456789e09l; +.0123456789e09F; +.0123456789e09D; +.0123456789e09L; |
---|
| 89 | -.0123456789e09; -.0123456789e09f; -.0123456789e09d; -.0123456789e09l; -.0123456789e09F; -.0123456789e09D; -.0123456789e09L; |
---|
| 90 | |
---|
| 91 | .0123456789E+09; .0123456789E+09f; .0123456789E+09d; .0123456789E+09l; .0123456789E+09F; .0123456789E+09D; .0123456789E+09L; |
---|
| 92 | +.0123456789E+09; +.0123456789E+09f; +.0123456789E+09d; +.0123456789E+09l; +.0123456789E+09F; +.0123456789E+09D; +.0123456789E+09L; |
---|
| 93 | -.0123456789E+09; -.0123456789E+09f; -.0123456789E+09d; -.0123456789E+09l; -.0123456789E+09F; -.0123456789E+09D; -.0123456789E+09L; |
---|
| 94 | |
---|
| 95 | .0123456789E-09; .0123456789E-09f; .0123456789E-09d; .0123456789E-09l; .0123456789E-09F; .0123456789E-09D; .0123456789E-09L; |
---|
| 96 | -.0123456789E-09; -.0123456789E-09f; -.0123456789E-09d; -.0123456789E-09l; -.0123456789E-09F; -.0123456789E-09D; -.0123456789E-09L; |
---|
| 97 | -.0123456789E-09; -.0123456789E-09f; -.0123456789E-09d; -.0123456789E-09l; -.0123456789E-09F; -.0123456789E-09D; -.0123456789E-09L; |
---|
| 98 | |
---|
| 99 | 0123456789.0123456789; 0123456789.0123456789f; 0123456789.0123456789d; 0123456789.0123456789l; 0123456789.0123456789F; 0123456789.0123456789D; 0123456789.0123456789L; |
---|
| 100 | +0123456789.0123456789; +0123456789.0123456789f; +0123456789.0123456789d; +0123456789.0123456789l; +0123456789.0123456789F; +0123456789.0123456789D; +0123456789.0123456789L; |
---|
| 101 | -0123456789.0123456789; -0123456789.0123456789f; -0123456789.0123456789d; -0123456789.0123456789l; -0123456789.0123456789F; -0123456789.0123456789D; -0123456789.0123456789L; |
---|
| 102 | |
---|
| 103 | 0123456789.0123456789E09; 0123456789.0123456789E09f; 0123456789.0123456789E09d; 0123456789.0123456789E09l; 0123456789.0123456789E09F; 0123456789.0123456789E09D; 0123456789.0123456789E09L; |
---|
| 104 | +0123456789.0123456789E09; +0123456789.0123456789E09f; +0123456789.0123456789E09d; +0123456789.0123456789E09l; +0123456789.0123456789E09F; +0123456789.0123456789E09D; +0123456789.0123456789E09L; |
---|
| 105 | -0123456789.0123456789E09; -0123456789.0123456789E09f; -0123456789.0123456789E09d; -0123456789.0123456789E09l; -0123456789.0123456789E09F; -0123456789.0123456789E09D; -0123456789.0123456789E09L; |
---|
| 106 | |
---|
| 107 | 0123456789.0123456789E+09; 0123456789.0123456789E+09f; 0123456789.0123456789E+09d; 0123456789.0123456789E+09l; 0123456789.0123456789E+09F; 0123456789.0123456789E+09D; 0123456789.0123456789E+09L; |
---|
| 108 | +0123456789.0123456789E+09; +0123456789.0123456789E+09f; +0123456789.0123456789E+09d; +0123456789.0123456789E+09l; +0123456789.0123456789E+09F; +0123456789.0123456789E+09D; +0123456789.0123456789E+09L; |
---|
| 109 | -0123456789.0123456789E+09; -0123456789.0123456789E+09f; -0123456789.0123456789E+09d; -0123456789.0123456789E+09l; -0123456789.0123456789E+09F; -0123456789.0123456789E+09D; -0123456789.0123456789E+09L; |
---|
| 110 | |
---|
| 111 | 0123456789.0123456789E-09; 0123456789.0123456789E-09f; 0123456789.0123456789E-09d; 0123456789.0123456789E-09l; 0123456789.0123456789E-09F; 0123456789.0123456789E-09D; 0123456789.0123456789E-09L; |
---|
| 112 | +0123456789.0123456789E-09; +0123456789.0123456789E-09f; +0123456789.0123456789E-09d; +0123456789.0123456789E-09l; +0123456789.0123456789E-09F; +0123456789.0123456789E-09D; +0123456789.0123456789E-09L; |
---|
| 113 | -0123456789.0123456789E-09; -0123456789.0123456789E-09f; -0123456789.0123456789E-09d; -0123456789.0123456789E-09l; -0123456789.0123456789E-09F; -0123456789.0123456789E-09D; -0123456789.0123456789E-09L; |
---|
[cd218e8] | 114 | |
---|
[4b891e9] | 115 | // decimal floating literals |
---|
[cd218e8] | 116 | |
---|
[4b891e9] | 117 | #if ! defined( __aarch64__ ) // unsupported on ARM after gcc-9 |
---|
| 118 | 0123456789.df; 0123456789.dd; 0123456789.dl; 0123456789.DF; 0123456789.DD; 0123456789.DL; |
---|
| 119 | +0123456789.df; +0123456789.dd; +0123456789.dl; +0123456789.DF; +0123456789.DD; +0123456789.DL; |
---|
| 120 | -0123456789.df; -0123456789.dd; -0123456789.dl; -0123456789.DF; -0123456789.DD; -0123456789.DL; |
---|
| 121 | |
---|
| 122 | 0123456789.e09df; 0123456789.e09dd; 0123456789.e09dl; 0123456789.e09DF; 0123456789.e09DD; 0123456789.e09DL; |
---|
| 123 | +0123456789.e09df; +0123456789.e09dd; +0123456789.e09dl; +0123456789.e09DF; +0123456789.e09DD; +0123456789.e09DL; |
---|
| 124 | -0123456789.e09df; -0123456789.e09dd; -0123456789.e09dl; -0123456789.e09DF; -0123456789.e09DD; -0123456789.e09DL; |
---|
| 125 | |
---|
| 126 | 0123456789.e+09df; 0123456789.e+09dd; 0123456789.e+09dl; 0123456789.e+09DF; 0123456789.e+09DD; 0123456789.e+09DL; |
---|
| 127 | +0123456789.e+09df; +0123456789.e+09dd; +0123456789.e+09dl; +0123456789.e+09DF; +0123456789.e+09DD; +0123456789.e+09DL; |
---|
| 128 | -0123456789.e+09df; -0123456789.e+09dd; -0123456789.e+09dl; -0123456789.e+09DF; -0123456789.e+09DD; -0123456789.e+09DL; |
---|
| 129 | |
---|
| 130 | 0123456789.e-09df; 0123456789.e-09dd; 0123456789.e-09dl; 0123456789.e-09DF; 0123456789.e-09DD; 0123456789.e-09DL; |
---|
| 131 | +0123456789.e-09df; +0123456789.e-09dd; +0123456789.e-09dl; +0123456789.e-09DF; +0123456789.e-09DD; +0123456789.e-09DL; |
---|
| 132 | -0123456789.e-09df; -0123456789.e-09dd; -0123456789.e-09dl; -0123456789.e-09DF; -0123456789.e-09DD; -0123456789.e-09DL; |
---|
| 133 | |
---|
| 134 | .0123456789df; .0123456789dd; .0123456789dl; .0123456789DF; .0123456789DD; .0123456789DL; |
---|
| 135 | +.0123456789df; +.0123456789dd; +.0123456789dl; +.0123456789DF; +.0123456789DD; +.0123456789DL; |
---|
| 136 | -.0123456789df; -.0123456789dd; -.0123456789dl; -.0123456789DF; -.0123456789DD; -.0123456789DL; |
---|
| 137 | |
---|
| 138 | .0123456789e09df; .0123456789e09dd; .0123456789e09dl; .0123456789e09DF; .0123456789e09DD; .0123456789e09DL; |
---|
| 139 | +.0123456789e09df; +.0123456789e09dd; +.0123456789e09dl; +.0123456789e09DF; +.0123456789e09DD; +.0123456789e09DL; |
---|
| 140 | -.0123456789e09df; -.0123456789e09dd; -.0123456789e09dl; -.0123456789e09DF; -.0123456789e09DD; -.0123456789e09DL; |
---|
| 141 | |
---|
| 142 | .0123456789E+09df; .0123456789E+09dd; .0123456789E+09dl; .0123456789E+09DF; .0123456789E+09DD; .0123456789E+09DL; |
---|
| 143 | +.0123456789E+09df; +.0123456789E+09dd; +.0123456789E+09dl; +.0123456789E+09DF; +.0123456789E+09DD; +.0123456789E+09DL; |
---|
| 144 | -.0123456789E+09df; -.0123456789E+09dd; -.0123456789E+09dl; -.0123456789E+09DF; -.0123456789E+09DD; -.0123456789E+09DL; |
---|
| 145 | |
---|
| 146 | .0123456789E-09df; .0123456789E-09dd; .0123456789E-09dl; .0123456789E-09DF; .0123456789E-09DD; .0123456789E-09DL; |
---|
| 147 | -.0123456789E-09df; -.0123456789E-09dd; -.0123456789E-09dl; -.0123456789E-09DF; -.0123456789E-09DD; -.0123456789E-09DL; |
---|
| 148 | -.0123456789E-09df; -.0123456789E-09dd; -.0123456789E-09dl; -.0123456789E-09DF; -.0123456789E-09DD; -.0123456789E-09DL; |
---|
| 149 | |
---|
| 150 | 0123456789.0123456789df; 0123456789.0123456789dd; 0123456789.0123456789dl; 0123456789.0123456789DF; 0123456789.0123456789DD; 0123456789.0123456789DL; |
---|
| 151 | +0123456789.0123456789df; +0123456789.0123456789dd; +0123456789.0123456789dl; +0123456789.0123456789DF; +0123456789.0123456789DD; +0123456789.0123456789DL; |
---|
| 152 | -0123456789.0123456789df; -0123456789.0123456789dd; -0123456789.0123456789dl; -0123456789.0123456789DF; -0123456789.0123456789DD; -0123456789.0123456789DL; |
---|
| 153 | |
---|
| 154 | 0123456789.0123456789E09df; 0123456789.0123456789E09dd; 0123456789.0123456789E09dl; 0123456789.0123456789E09DF; 0123456789.0123456789E09DD; 0123456789.0123456789E09DL; |
---|
| 155 | +0123456789.0123456789E09df; +0123456789.0123456789E09dd; +0123456789.0123456789E09dl; +0123456789.0123456789E09DF; +0123456789.0123456789E09DD; +0123456789.0123456789E09DL; |
---|
| 156 | -0123456789.0123456789E09df; -0123456789.0123456789E09dd; -0123456789.0123456789E09dl; -0123456789.0123456789E09DF; -0123456789.0123456789E09DD; -0123456789.0123456789E09DL; |
---|
| 157 | |
---|
| 158 | 0123456789.0123456789E+09df; 0123456789.0123456789E+09dd; 0123456789.0123456789E+09dl; 0123456789.0123456789E+09DF; 0123456789.0123456789E+09DD; 0123456789.0123456789E+09DL; |
---|
| 159 | +0123456789.0123456789E+09df; +0123456789.0123456789E+09dd; +0123456789.0123456789E+09dl; +0123456789.0123456789E+09DF; +0123456789.0123456789E+09DD; +0123456789.0123456789E+09DL; |
---|
| 160 | -0123456789.0123456789E+09df; -0123456789.0123456789E+09dd; -0123456789.0123456789E+09dl; -0123456789.0123456789E+09DF; -0123456789.0123456789E+09DD; -0123456789.0123456789E+09DL; |
---|
| 161 | |
---|
| 162 | 0123456789.0123456789E-09df; 0123456789.0123456789E-09dd; 0123456789.0123456789E-09dl; 0123456789.0123456789E-09DF; 0123456789.0123456789E-09DD; 0123456789.0123456789E-09DL; |
---|
| 163 | +0123456789.0123456789E-09df; +0123456789.0123456789E-09dd; +0123456789.0123456789E-09dl; +0123456789.0123456789E-09DF; +0123456789.0123456789E-09DD; +0123456789.0123456789E-09DL; |
---|
| 164 | -0123456789.0123456789E-09df; -0123456789.0123456789E-09dd; -0123456789.0123456789E-09dl; -0123456789.0123456789E-09DF; -0123456789.0123456789E-09DD; -0123456789.0123456789E-09DL; |
---|
| 165 | #endif // ! __aarch64__ |
---|
[cd218e8] | 166 | |
---|
| 167 | // hexadecimal floating literals, must have exponent |
---|
| 168 | |
---|
| 169 | 0x0123456789.p09; 0x0123456789.p09f; 0x0123456789.p09l; 0x0123456789.p09F; 0x0123456789.p09L; |
---|
| 170 | +0x0123456789.p09; +0x0123456789.p09f; +0x0123456789.p09l; +0x0123456789.p09F; +0x0123456789.p09L; |
---|
| 171 | -0x0123456789.p09; -0x0123456789.p09f; -0x0123456789.p09l; -0x0123456789.p09F; -0x0123456789.p09L; |
---|
| 172 | |
---|
| 173 | 0x0123456789.p+09; 0x0123456789.p+09f; 0x0123456789.p+09l; 0x0123456789.p+09F; 0x0123456789.p+09L; |
---|
| 174 | +0x0123456789.p+09; +0x0123456789.p+09f; +0x0123456789.p+09l; +0x0123456789.p+09F; +0x0123456789.p+09L; |
---|
| 175 | -0x0123456789.p+09; -0x0123456789.p+09f; -0x0123456789.p+09l; -0x0123456789.p+09F; -0x0123456789.p+09L; |
---|
| 176 | |
---|
| 177 | 0x0123456789.p-09; 0x0123456789.p-09f; 0x0123456789.p-09l; 0x0123456789.p-09F; 0x0123456789.p-09L; |
---|
[201aeb9] | 178 | +0x0123456789.p-09; +0x0123456789.p-09f; +0x0123456789.p-09l; +0x0123456789.p-09F; +0x0123456789.p-09L; |
---|
[cd218e8] | 179 | -0x0123456789.p-09; -0x0123456789.p-09f; -0x0123456789.p-09l; -0x0123456789.p-09F; -0x0123456789.p-09L; |
---|
| 180 | |
---|
| 181 | 0x.0123456789p09; 0x.0123456789p09f; 0x.0123456789p09l; 0x.0123456789p09F; 0x.0123456789p09L; |
---|
| 182 | +0x.0123456789p09; +0x.0123456789p09f; +0x.0123456789p09l; +0x.0123456789p09F; +0x.0123456789p09L; |
---|
| 183 | -0x.0123456789p09; -0x.0123456789p09f; -0x.0123456789p09l; -0x.0123456789p09F; -0x.0123456789p09L; |
---|
| 184 | |
---|
| 185 | 0x.0123456789p+09; 0x.0123456789p+09f; 0x.0123456789p+09l; 0x.0123456789p+09F; 0x.0123456789p+09L; |
---|
| 186 | +0x.0123456789p+09; +0x.0123456789p+09f; +0x.0123456789p+09l; +0x.0123456789p+09F; +0x.0123456789p+09L; |
---|
| 187 | -0x.0123456789p+09; -0x.0123456789p+09f; -0x.0123456789p+09l; -0x.0123456789p+09F; -0x.0123456789p+09L; |
---|
| 188 | |
---|
| 189 | 0x.0123456789P-09; 0x.0123456789P-09f; 0x.0123456789P-09l; 0x.0123456789P-09F; 0x.0123456789P-09L; |
---|
[201aeb9] | 190 | +0x.0123456789P-09; +0x.0123456789P-09f; +0x.0123456789P-09l; +0x.0123456789P-09F; +0x.0123456789P-09L; |
---|
[cd218e8] | 191 | -0x.0123456789P-09; -0x.0123456789P-09f; -0x.0123456789P-09l; -0x.0123456789P-09F; -0x.0123456789P-09L; |
---|
| 192 | |
---|
| 193 | 0X0123456789.0123456789P09; 0X0123456789.0123456789P09f; 0X0123456789.0123456789P09l; 0X0123456789.0123456789P09F; 0X0123456789.0123456789P09L; |
---|
| 194 | +0X0123456789.0123456789P09; +0X0123456789.0123456789P09f; +0X0123456789.0123456789P09l; +0X0123456789.0123456789P09F; +0X0123456789.0123456789P09L; |
---|
| 195 | -0X0123456789.0123456789P09; -0X0123456789.0123456789P09f; -0X0123456789.0123456789P09l; -0X0123456789.0123456789P09F; -0X0123456789.0123456789P09L; |
---|
| 196 | |
---|
| 197 | 0X0123456789.0123456789P+09; 0X0123456789.0123456789P+09f; 0X0123456789.0123456789P+09l; 0X0123456789.0123456789P+09F; 0X0123456789.0123456789P+09L; |
---|
| 198 | +0X0123456789.0123456789P+09; +0X0123456789.0123456789P+09f; +0X0123456789.0123456789P+09l; +0X0123456789.0123456789P+09F; +0X0123456789.0123456789P+09L; |
---|
| 199 | -0X0123456789.0123456789P+09; -0X0123456789.0123456789P+09f; -0X0123456789.0123456789P+09l; -0X0123456789.0123456789P+09F; -0X0123456789.0123456789P+09L; |
---|
| 200 | |
---|
| 201 | 0X0123456789.0123456789P-09; 0X0123456789.0123456789P-09f; 0X0123456789.0123456789P-09l; 0X0123456789.0123456789P-09F; 0X0123456789.0123456789P-09L; |
---|
[201aeb9] | 202 | +0X0123456789.0123456789P-09; +0X0123456789.0123456789P-09f; +0X0123456789.0123456789P-09l; +0X0123456789.0123456789P-09F; +0X0123456789.0123456789P-09L; |
---|
[cd218e8] | 203 | -0X0123456789.0123456789P-09; -0X0123456789.0123456789P-09f; -0X0123456789.0123456789P-09l; -0X0123456789.0123456789P-09F; -0X0123456789.0123456789P-09L; |
---|
[201aeb9] | 204 | |
---|
[ed9949b] | 205 | #if defined( __i386 ) || defined( __x86_64 ) |
---|
[e782290] | 206 | #if defined(__GNUC__) && __GNUC_PREREQ(7,0) // gcc version >= 7 |
---|
[7fabfdf] | 207 | // floating with length, gcc f16/f128x unsupported and no prelude code for any _FloatXXx, so they work by conversion to long double |
---|
| 208 | |
---|
| 209 | /* 0123456789.f16; */ 0123456789.f32; 0123456789.f32x; 0123456789.f64; 0123456789.f64x; 0123456789.W; 0123456789.f128; 0123456789.q; /* 0123456789.f128x; */ |
---|
| 210 | /* +0123456789.f16; */ +0123456789.f32; +0123456789.f32x; +0123456789.f64; +0123456789.f64x; +0123456789.w; +0123456789.f128; +0123456789.Q; /* +0123456789.f128x; */ |
---|
| 211 | /* -0123456789.f16; */ -0123456789.f32; -0123456789.f32x; -0123456789.f64; -0123456789.f64x; -0123456789.W; -0123456789.f128; -0123456789.q; /* -0123456789.f128x; */ |
---|
| 212 | |
---|
| 213 | /* 0123456789.e09F16; */ 0123456789.e09F32; 0123456789.e09F32x; 0123456789.e09F64; 0123456789.e09F64x; 0123456789.e09W; 0123456789.e09F128; 0123456789.e09q; /* .0123456789e09q; */ |
---|
| 214 | /* +0123456789.e+09F16; */ +0123456789.e+09F32; +0123456789.e+09F32x; +0123456789.e+09F64; +0123456789.e+09F64x; +0123456789.e+09w; +0123456789.e+09F128; +0123456789.e+09Q; /* +.0123456789E+09Q; */ |
---|
| 215 | /* -0123456789.e-09F16; */ -0123456789.e-09F32; -0123456789.e-09F32x; -0123456789.e-09F64; -0123456789.e-09F64x; -0123456789.e-09W; -0123456789.e-09F128; -0123456789.e-09q; /* -.0123456789E-09q; */ |
---|
| 216 | |
---|
| 217 | /* .0123456789e09F16; */ .0123456789e09F32; .0123456789e09F32x; .0123456789e09F64; .0123456789e09F64x; .0123456789e09W; .0123456789e09F128; .0123456789e09q; /* .0123456789e09q; */ |
---|
| 218 | /* +.0123456789e+09F16; */ +.0123456789e+09F32; +.0123456789e+09F32x; +.0123456789e+09F64; +.0123456789e+09F64x; +.0123456789e+09w; +.0123456789e+09F128; +.0123456789e+09Q; /* +.0123456789E+09Q; */ |
---|
| 219 | /* -.0123456789e-09F16; */ -.0123456789e-09F32; -.0123456789e-09F32x; -.0123456789e-09F64; -.0123456789e-09F64x; -.0123456789e-09W; -.0123456789e-09F128; -.0123456789e-09q; /* -.0123456789E-09q; */ |
---|
| 220 | |
---|
| 221 | /* 0123456789.0123456789F16; */ 0123456789.0123456789F32; 0123456789.0123456789F32x; 0123456789.0123456789F64; 0123456789.0123456789F64x; 0123456789.0123456789W; 0123456789.0123456789F128; 0123456789.0123456789q; /* 0123456789.0123456789q; */ |
---|
| 222 | /* +0123456789.0123456789F16; */ +0123456789.0123456789F32; +0123456789.0123456789F32x; +0123456789.0123456789F64; +0123456789.0123456789F64x; +0123456789.0123456789w; +0123456789.0123456789F128; +0123456789.0123456789Q; /* +0123456789.0123456789Q; */ |
---|
| 223 | /* -0123456789.0123456789F16; */ -0123456789.0123456789F32; -0123456789.0123456789F32x; -0123456789.0123456789F64; -0123456789.0123456789F64x; -0123456789.0123456789W; -0123456789.0123456789F128; -0123456789.0123456789q; /* -0123456789.0123456789q; */ |
---|
| 224 | |
---|
| 225 | /* 0123456789.0123456789E09F16; */ 0123456789.0123456789E09F32; 0123456789.0123456789E09F32x; 0123456789.0123456789E09F64; 0123456789.0123456789E09F64x; 0123456789.0123456789E09W; 0123456789.0123456789E09F128; 0123456789.0123456789E09q; /* 0123456789.0123456789E09q; */ |
---|
| 226 | /* +0123456789.0123456789E+09F16; */ +0123456789.0123456789E+09F32; +0123456789.0123456789E+09F32x; +0123456789.0123456789E+09F64; +0123456789.0123456789E+09F64x; +0123456789.0123456789E+09w; +0123456789.0123456789E+09F128; +0123456789.0123456789E+09Q; /* +0123456789.0123456789E+09Q; */ |
---|
| 227 | /* -0123456789.0123456789E-09F16; */ -0123456789.0123456789E-09F32; -0123456789.0123456789E-09F32x; -0123456789.0123456789E-09F64; -0123456789.0123456789E-09F64x; -0123456789.0123456789E-09W; -0123456789.0123456789E-09F128; -0123456789.0123456789E-09q; /* -0123456789.0123456789E-09q; */ |
---|
| 228 | |
---|
| 229 | /* 0x123456789.p09f16; */ 0x123456789.p09f32; 0x123456789.p09f32x; 0x123456789.p09f64; 0x123456789.p09f64x; 0x123456789.p09W; 0x123456789.p09f128; 0x123456789.p09q; /* 0x123456789.p09f128x; */ |
---|
| 230 | /* +0x123456789.P+09f16; */ +0x123456789.P+09f32; +0x123456789.P+09f32x; +0x123456789.P+09f64; +0x123456789.P+09f64x; +0x123456789.P+09w; +0x123456789.P+09f128; +0x123456789.P+09Q; /* +0x123456789.P+09f128x; */ |
---|
| 231 | /* -0x123456789.P-09f16; */ -0x123456789.P-09f32; -0x123456789.P-09f32x; -0x123456789.P-09f64; -0x123456789.P-09f64x; -0x123456789.P-09W; -0x123456789.P-09f128; -0x123456789.P-09q; /* -0x123456789.P-09f128x; */ |
---|
| 232 | |
---|
| 233 | /* 0x123456789.p09F16; */ 0x123456789.p09F32; 0x123456789.p09F32x; 0x123456789.p09F64; 0x123456789.p09F64x; 0x123456789.p09W; 0x123456789.p09F128; 0x123456789.p09q; /* .0123456789p09q; */ |
---|
| 234 | /* +0x123456789.p+09F16; */ +0x123456789.p+09F32; +0x123456789.p+09F32x; +0x123456789.p+09F64; +0x123456789.p+09F64x; +0x123456789.p+09w; +0x123456789.p+09F128; +0x123456789.p+09Q; /* +.0123456789p+09Q; */ |
---|
| 235 | /* -0x123456789.p-09F16; */ -0x123456789.p-09F32; -0x123456789.p-09F32x; -0x123456789.p-09F64; -0x123456789.p-09F64x; -0x123456789.p-09W; -0x123456789.p-09F128; -0x123456789.p-09q; /* -.0123456789P-09q; */ |
---|
| 236 | |
---|
| 237 | /* 0X.0123456789p09F16; */ 0X.0123456789p09F32; 0X.0123456789p09F32x; 0X.0123456789p09F64; 0X.0123456789p09F64x; 0X.0123456789p09W; 0X.0123456789p09F128; 0X.0123456789p09q; /* 0X.0123456789p09q; */ |
---|
| 238 | /* +0X.0123456789p+09F16; */ +0X.0123456789p+09F32; +0X.0123456789p+09F32x; +0X.0123456789p+09F64; +0X.0123456789p+09F64x; +0X.0123456789p+09w; +0X.0123456789p+09F128; +0X.0123456789p+09Q; /* +0X.0123456789p+09Q; */ |
---|
| 239 | /* -0X.0123456789p-09F16; */ -0X.0123456789p-09F32; -0X.0123456789p-09F32x; -0X.0123456789p-09F64; -0X.0123456789p-09F64x; -0X.0123456789p-09W; -0X.0123456789p-09F128; -0X.0123456789p-09q; /* -0X.0123456789P-09q; */ |
---|
| 240 | |
---|
| 241 | /* 0x123456789.0123456789P09F16; */ 0x123456789.0123456789P09F32; 0x123456789.0123456789P09F32x; 0x123456789.0123456789P09F64; 0x123456789.0123456789P09F64x; 0x123456789.0123456789P09W; 0x123456789.0123456789P09F128; 0x123456789.0123456789P09q; /* 0x123456789.0123456789P09q; */ |
---|
| 242 | /* +0x123456789.0123456789P+09F16; */ +0x123456789.0123456789P+09F32; +0x123456789.0123456789P+09F32x; +0x123456789.0123456789P+09F64; +0x123456789.0123456789P+09F64x; +0x123456789.0123456789P+09w; +0x123456789.0123456789P+09F128; +0x123456789.0123456789P+09Q; /* +0x123456789.0123456789P+09Q; */ |
---|
| 243 | /* -0x123456789.0123456789p-09F16; */ -0x123456789.0123456789p-09F32; -0x123456789.0123456789p-09F32x; -0x123456789.0123456789p-09F64; -0x123456789.0123456789p-09F64x; -0x123456789.0123456789p-09W; -0x123456789.0123456789p-09F128; -0x123456789.0123456789p-09q; /* -0x123456789.0123456789p-09q; */ |
---|
| 244 | |
---|
| 245 | /* 0x123456789.0123456789P09F16; */ 0x123456789.0123456789P09F32; 0x123456789.0123456789P09F32x; 0x123456789.0123456789P09F64; 0x123456789.0123456789P09F64x; 0x123456789.0123456789P09W; 0x123456789.0123456789P09F128; 0x123456789.0123456789P09q; /* 0x123456789.0123456789P09q; */ |
---|
| 246 | /* +0x123456789.0123456789p+09F16; */ +0x123456789.0123456789p+09F32; +0x123456789.0123456789p+09F32x; +0x123456789.0123456789p+09F64; +0x123456789.0123456789p+09F64x; +0x123456789.0123456789p+09w; +0x123456789.0123456789p+09F128; +0x123456789.0123456789p+09Q; /* +0x123456789.0123456789p+09Q; */ |
---|
| 247 | /* -0x123456789.0123456789P-09F16; */ -0x123456789.0123456789P-09F32; -0x123456789.0123456789P-09F32x; -0x123456789.0123456789P-09F64; -0x123456789.0123456789P-09F64x; -0x123456789.0123456789P-09W; -0x123456789.0123456789P-09F128; -0x123456789.0123456789P-09q; /* -0x123456789.0123456789P-09q; */ |
---|
[e782290] | 248 | #endif // __GNUC_PREREQ(7,0) |
---|
[ed9949b] | 249 | #endif // __i386 ) || __x86_64 |
---|
[7fabfdf] | 250 | |
---|
[201aeb9] | 251 | #ifdef __CFA__ |
---|
| 252 | // fixed-size length |
---|
| 253 | |
---|
[ea46db7] | 254 | // binary |
---|
[9428d52] | 255 | 0b01101011_l8; 0b01101011_l16; 0b01101011_l32; 0b01101011_l64; 0b01101011_l8u; 0b01101011_ul16; 0b01101011_l32u; 0b01101011_ul64; |
---|
| 256 | +0b01101011_l8; +0b01101011_l16; +0b01101011_l32; +0b01101011_l64; +0b01101011_l8u; +0b01101011_ul16; +0b01101011_l32u; +0b01101011_ul64; |
---|
| 257 | -0b01101011_l8; -0b01101011_l16; -0b01101011_l32; -0b01101011_l64; -0b01101011_l8u; -0b01101011_ul16; -0b01101011_l32u; -0b01101011_ul64; |
---|
| 258 | |
---|
| 259 | #ifdef __LP64__ // 64-bit processor |
---|
| 260 | 0b01101011_l128; 0b01101011_ul128; |
---|
| 261 | +0b01101011_l128; +0b01101011_ul128; |
---|
| 262 | -0b01101011_l128; -0b01101011_ul128; |
---|
| 263 | #endif // __LP64__ |
---|
[ea46db7] | 264 | |
---|
[201aeb9] | 265 | // octal |
---|
[9428d52] | 266 | 01234567_l8; 01234567_l16; 01234567_l32; 01234567_l64; 01234567_l8u; 01234567_ul16; 01234567_l32u; 01234567_ul64; |
---|
[7fabfdf] | 267 | +01234567_l8; +01234567_l16; +01234567_l32; +01234567_l64; +01234567_ul8; +01234567_ul16; +01234567_l32u; +01234567_ul64; |
---|
[9428d52] | 268 | -01234567_l8; -01234567_l16; -01234567_l32; -01234567_l64; -01234567_l8u; -01234567_ul16; -01234567_l32u; -01234567_ul64; |
---|
| 269 | |
---|
[c5b55c4] | 270 | #if defined( __SIZEOF_INT128__ ) |
---|
[9428d52] | 271 | 01234567_l128; 01234567_ul128; |
---|
| 272 | +01234567_l128; +01234567_ul128; |
---|
| 273 | -01234567_l128; -01234567_ul128; |
---|
[c5b55c4] | 274 | #endif // __SIZEOF_INT128__ |
---|
[201aeb9] | 275 | |
---|
| 276 | // decimal |
---|
[9428d52] | 277 | 1234567890L8; 1234567890L16; 1234567890l32; 1234567890l64; 1234567890UL8; 1234567890L16U; 1234567890Ul32; 1234567890l64u; |
---|
| 278 | +1234567890L8; +1234567890L16; +1234567890l32; +1234567890l64; +1234567890UL8; +1234567890L16U; +1234567890Ul32; +1234567890l64u; |
---|
| 279 | -1234567890L8; -1234567890L16; -1234567890l32; -1234567890l64; -1234567890UL8; -1234567890L16U; -1234567890Ul32; -1234567890l64u; |
---|
| 280 | |
---|
[c5b55c4] | 281 | #if defined( __SIZEOF_INT128__ ) |
---|
[9428d52] | 282 | 1234567890l128; 1234567890l128u; |
---|
| 283 | +1234567890l128; +1234567890l128u; |
---|
| 284 | -1234567890l128; -1234567890l128u; |
---|
[c5b55c4] | 285 | 1234567890123456789_L128u; 1234567890123456789_L128u; |
---|
| 286 | 18446708753438544741_l64u; 18446708753438544741_Ul64; |
---|
| 287 | #endif // __SIZEOF_INT128__ |
---|
[201aeb9] | 288 | |
---|
| 289 | // hexadecimal |
---|
| 290 | 0x0123456789abcdef_l8; 0x0123456789abcdef_l16; 0x0123456789abcdefl32; 0x0123456789abcdefl64; 0x0123456789abcdef_ul8; 0x0123456789abcdef_l16u; 0x0123456789abcdeful32; 0x0123456789abcdefl64u; |
---|
| 291 | +0x0123456789abcdef_l8; +0x0123456789abcdef_l16; +0x0123456789abcdefl32; +0x0123456789abcdefl64; +0x0123456789abcdef_ul8; +0x0123456789abcdef_l16u; +0x0123456789abcdeful32; +0x0123456789abcdefl64u; |
---|
| 292 | -0x0123456789abcdef_l8; -0x0123456789abcdef_l16; -0x0123456789abcdefl32; -0x0123456789abcdefl64; -0x0123456789abcdef_ul8; -0x0123456789abcdef_l16u; -0x0123456789abcdeful32; -0x0123456789abcdefl64u; |
---|
| 293 | |
---|
| 294 | 0x0123456789ABCDEF_l8; 0x0123456789ABCDEF_l16; 0x0123456789ABCDEFl32; 0x0123456789ABCDEFl64; 0x0123456789ABCDEF_ul8; 0x0123456789ABCDEF_l16u; 0x0123456789ABCDEFul32; 0x0123456789ABCDEFl64u; |
---|
| 295 | +0x0123456789ABCDEF_l8; +0x0123456789ABCDEF_l16; +0x0123456789ABCDEFl32; +0x0123456789ABCDEFl64; +0x0123456789ABCDEF_ul8; +0x0123456789ABCDEF_l16u; +0x0123456789ABCDEFul32; +0x0123456789ABCDEFl64u; |
---|
| 296 | -0x0123456789ABCDEF_l8; -0x0123456789ABCDEF_l16; -0x0123456789ABCDEFl32; -0x0123456789ABCDEFl64; -0x0123456789ABCDEF_ul8; -0x0123456789ABCDEF_l16u; -0x0123456789ABCDEFul32; -0x0123456789ABCDEFl64u; |
---|
| 297 | |
---|
| 298 | 0X0123456789abcdef_l8; 0X0123456789abcdef_l16; 0X0123456789abcdefl32; 0X0123456789abcdefl64; 0X0123456789abcdef_ul8; 0X0123456789abcdef_l16u; 0X0123456789abcdeful32; 0X0123456789abcdefl64u; |
---|
| 299 | +0X0123456789abcdef_l8; +0X0123456789abcdef_l16; +0X0123456789abcdefl32; +0X0123456789abcdefl64; +0X0123456789abcdef_ul8; +0X0123456789abcdef_l16u; +0X0123456789abcdeful32; +0X0123456789abcdefl64u; |
---|
| 300 | -0X0123456789abcdef_l8; -0X0123456789abcdef_l16; -0X0123456789abcdefl32; -0X0123456789abcdefl64; -0X0123456789abcdef_ul8; -0X0123456789abcdef_l16u; -0X0123456789abcdeful32; -0X0123456789abcdefl64u; |
---|
| 301 | |
---|
| 302 | 0X0123456789ABCDEF_l8; 0X0123456789ABCDEF_l16; 0X0123456789ABCDEFl32; 0X0123456789ABCDEFl64; 0X0123456789ABCDEF_ul8; 0X0123456789ABCDEF_l16u; 0X0123456789ABCDEFul32; 0X0123456789ABCDEFl64u; |
---|
| 303 | +0X0123456789ABCDEF_l8; +0X0123456789ABCDEF_l16; +0X0123456789ABCDEFl32; +0X0123456789ABCDEFl64; +0X0123456789ABCDEF_ul8; +0X0123456789ABCDEF_l16u; +0X0123456789ABCDEFul32; +0X0123456789ABCDEFl64u; |
---|
| 304 | -0X0123456789ABCDEF_l8; -0X0123456789ABCDEF_l16; -0X0123456789ABCDEFl32; -0X0123456789ABCDEFl64; -0X0123456789ABCDEF_ul8; -0X0123456789ABCDEF_l16u; -0X0123456789ABCDEFul32; -0X0123456789ABCDEFl64u; |
---|
| 305 | |
---|
[beec62c] | 306 | // char, short, int suffix overloading |
---|
[62edde5] | 307 | |
---|
[cd218e8] | 308 | f( 'a' ); |
---|
| 309 | f( 20_hh ); |
---|
[beec62c] | 310 | f( 21_hhu ); |
---|
| 311 | f( 22_h ); |
---|
| 312 | f( 23_uh ); |
---|
| 313 | f( 24z ); |
---|
[cd218e8] | 314 | #endif // __CFA__ |
---|
[62edde5] | 315 | |
---|
[cd218e8] | 316 | // character literals |
---|
[62edde5] | 317 | |
---|
[cd218e8] | 318 | ' '; 'a'; '"'; '_'; |
---|
| 319 | '\''; '\"'; '\?'; '\\'; // simple escape |
---|
| 320 | '\a'; '\b'; '\e'; /* GCC */ '\f'; '\n'; '\r'; '\t'; '\v'; |
---|
| 321 | '\0'; '\377'; // octal escape |
---|
| 322 | '\xf'; '\xff'; // hex escape |
---|
[62edde5] | 323 | |
---|
[cd218e8] | 324 | u' '; u'a'; u'"'; u'_'; |
---|
| 325 | U' '; U'a'; U'"'; U'_'; |
---|
| 326 | L' '; L'a'; L'"'; L'_'; |
---|
[62edde5] | 327 | |
---|
| 328 | // warnings/errors |
---|
| 329 | |
---|
[cd218e8] | 330 | #ifdef ERROR |
---|
| 331 | ''; // empty character |
---|
| 332 | 'aa'; // multi-character |
---|
| 333 | 'a\na'; // multi-character, embedded escape |
---|
| 334 | 'a\0a'; |
---|
| 335 | '\xfff'; // hex escape out of range |
---|
| 336 | '_\377_'; // multi-character |
---|
| 337 | '_\xff_'; |
---|
| 338 | '\xffff'; // hex escape out of range |
---|
| 339 | 'a\xff34w'; |
---|
| 340 | '\xf_f'; // multi-character |
---|
| 341 | '\xff_ff'; |
---|
| 342 | #endif // ERROR |
---|
| 343 | |
---|
| 344 | // string literals |
---|
| 345 | |
---|
| 346 | " "; "a"; "'"; '_'; "abcdefghijklmnopqrstuvwxyz"; |
---|
| 347 | ""; "aa"; "a\na"; "a\0a"; "_\377_"; "_\xff_"; "\xf_f"; |
---|
| 348 | "\'"; "\""; "\?"; "\\"; // simple escape |
---|
| 349 | "\a"; "\b"; "\e"; /* GCC */ "\f"; "\n"; "\r"; "\t"; "\v"; |
---|
| 350 | "\0"; "\377"; // octal escape |
---|
| 351 | "\xf"; "\xff"; // hex escape |
---|
| 352 | |
---|
| 353 | u8" "; u8"a"; u8"'"; u'_'; u8"abcdefghijklmnopqrstuvwxyz"; |
---|
| 354 | u" "; u"a"; u"'"; u'_'; u"abcdefghijklmnopqrstuvwxyz"; |
---|
| 355 | U" "; U"a"; U"'"; U'_'; U"abcdefghijklmnopqrstuvwxyz"; |
---|
| 356 | L" "; L"a"; L"'"; L'_'; L"abcdefghijklmnopqrstuvwxyz"; |
---|
| 357 | |
---|
| 358 | "\xFF"; u"\xFFFF"; U"\xFFFFFFFF"; L"\xFFFFFFFF"; // maximum size |
---|
| 359 | |
---|
| 360 | // concatenation |
---|
| 361 | |
---|
[ea0c5e3] | 362 | "\x12" "3"; // 2 characters not 1! |
---|
[cd218e8] | 363 | |
---|
[ea0c5e3] | 364 | "a" "b" u8"c"; |
---|
| 365 | "a" u8"b" "c"; |
---|
| 366 | "a" u8"b" u8"c"; |
---|
| 367 | u8"a" "b" u8"c"; |
---|
| 368 | u8"a" u8"b" u8"c"; |
---|
[cd218e8] | 369 | |
---|
| 370 | "a" "b" u"c"; |
---|
| 371 | "a" u"b" "c"; |
---|
[ea0c5e3] | 372 | "a" u"b" u"c"; |
---|
[cd218e8] | 373 | u"a" "b" u"c"; |
---|
| 374 | u"a" u"b" u"c"; |
---|
[62edde5] | 375 | |
---|
[ea0c5e3] | 376 | "a" "b" U"c"; |
---|
| 377 | "a" U"b" "c"; |
---|
| 378 | "a" U"b" U"c"; |
---|
| 379 | U"a" "b" U"c"; |
---|
| 380 | U"a" U"b" U"c"; |
---|
| 381 | |
---|
| 382 | "a" "b" L"c"; |
---|
| 383 | "a" L"b" "c"; |
---|
| 384 | "a" L"b" L"c"; |
---|
| 385 | L"a" "b" L"c"; |
---|
| 386 | L"a" L"b" L"c"; |
---|
| 387 | |
---|
[62edde5] | 388 | // warnings/errors |
---|
| 389 | |
---|
[cd218e8] | 390 | #ifdef ERROR |
---|
| 391 | "\xff_ff"; |
---|
| 392 | "\xfff"; // hex escape out of range |
---|
| 393 | "a\xff34w"; |
---|
| 394 | "\xffff"; |
---|
| 395 | #endif // ERROR |
---|
[62edde5] | 396 | } |
---|
| 397 | |
---|
| 398 | // Local Variables: // |
---|
[cd218e8] | 399 | // tab-width: 4 // |
---|
[dc8511c] | 400 | // compile-command: "cfa literals.cfa" // |
---|
[62edde5] | 401 | // End: // |
---|