Fix static assert to support literal string instead of just printing the sring of the current token as it use to be so we can now use _Static_assert(0, "0" "1") which will print __FILE__ __LINE__ error: 01
Showing the changes to tests (2 of 3 files). Show all
Unified · Split
| @@ -186,6 +186,10 @@ void * _Alignas(16) p1; · 185 unmodified lines | |||
| 186 | _Static_assert(ONE == 0, "don't show me this"); | 186 | _Static_assert(ONE == 0, "don't show me this"); |
| 187 | _Static_assert(ONE == 1, "ONE is not 1"); | 187 | _Static_assert(ONE == 1, "ONE is not 1"); |
| 188 | 188 | ||
| 189 | #elif defined test_static_assert_2 | ||
| 190 | _Static_assert(1, "1"" is 1"); | ||
| 191 | _Static_assert(0, "0"" is 0"); | ||
| 192 | |||
| 189 | #elif defined test_void_array | 193 | #elif defined test_void_array |
| 190 | void t[3]; | 194 | void t[3]; |
| 191 | 195 | ||
| @@ -89,24 +89,27 @@ · 88 unmodified lines | |||
| 89 | 60_errors_and_warnings.c:181: error: identifier expected | 89 | 60_errors_and_warnings.c:181: error: identifier expected |
| 90 | 90 | ||
| 91 | [test_static_assert] | 91 | [test_static_assert] |
| 92 | 60_errors_and_warnings.c:187: error: "ONE is not 1" | 92 | 60_errors_and_warnings.c:187: error: ONE is not 1 |
| 93 | |||
| 94 | [test_static_assert_2] | ||
| 95 | 60_errors_and_warnings.c:191: error: 0 is 0 | ||
| 93 | 96 | ||
| 94 | [test_void_array] | 97 | [test_void_array] |
| 95 | 60_errors_and_warnings.c:190: error: declaration of an array of incomplete type elements | 98 | 60_errors_and_warnings.c:194: error: declaration of an array of incomplete type elements |
| 96 | 99 | ||
| 97 | [test_incomplete_enum_array] | 100 | [test_incomplete_enum_array] |
| 98 | 60_errors_and_warnings.c:193: error: declaration of an array of incomplete type elements | 101 | 60_errors_and_warnings.c:197: error: declaration of an array of incomplete type elements |
| 99 | 102 | ||
| 100 | [test_incomplete_struct_array] | 103 | [test_incomplete_struct_array] |
| 101 | 60_errors_and_warnings.c:196: error: declaration of an array of incomplete type elements | 104 | 60_errors_and_warnings.c:200: error: declaration of an array of incomplete type elements |
| 102 | 105 | ||
| 103 | [test_const_fun_array] | 106 | [test_const_fun_array] |
| 104 | 60_errors_and_warnings.c:200: error: declaration of an array of functions | 107 | 60_errors_and_warnings.c:204: error: declaration of an array of functions |
| 105 | 108 | ||
| 106 | [test_incomplete_array_array] | 109 | [test_incomplete_array_array] |
| 107 | 110 | ||
| 108 | [test_extern_array] | 111 | [test_extern_array] |
| 109 | 60_errors_and_warnings.c:216: error: incompatible types for redefinition of 'x' | 112 | 60_errors_and_warnings.c:220: error: incompatible types for redefinition of 'x' |
| 110 | 113 | ||
| 111 | [test_func_1] | 114 | [test_func_1] |
| 112 | hello: a = 123 | 115 | hello: a = 123 |
| @@ -115,17 +118,17 @@ hello: a = 123 · 2 unmodified lines | |||
| 115 | hello: a = 123 | 118 | hello: a = 123 |
| 116 | 119 | ||
| 117 | [test_func_3] | 120 | [test_func_3] |
| 118 | 60_errors_and_warnings.c:246: warning: static storage ignored for redefinition of 'hello' | 121 | 60_errors_and_warnings.c:250: warning: static storage ignored for redefinition of 'hello' |
| 119 | hello: a = 123 | 122 | hello: a = 123 |
| 120 | 123 | ||
| 121 | [test_func_4] | 124 | [test_func_4] |
| 122 | hello: a = 123 | 125 | hello: a = 123 |
| 123 | 126 | ||
| 124 | [test_func_5] | 127 | [test_func_5] |
| 125 | 60_errors_and_warnings.c:246: error: incompatible types for redefinition of 'hello' | 128 | 60_errors_and_warnings.c:250: error: incompatible types for redefinition of 'hello' |
| 126 | 129 | ||
| 127 | [test_func_6] | 130 | [test_func_6] |
| 128 | 60_errors_and_warnings.c:234: error: function without file scope cannot be static | 131 | 60_errors_and_warnings.c:238: error: function without file scope cannot be static |
| 129 | 132 | ||
| 130 | [test_var_1] | 133 | [test_var_1] |
| 131 | main : 1 ; 1 | 134 | main : 1 ; 1 |
| @@ -138,6 +141,6 @@ main : 2 ; 2 · 6 unmodified lines | |||
| 138 | bar : 3 ; 3 | 141 | bar : 3 ; 3 |
| 139 | 142 | ||
| 140 | [test_var_3] | 143 | [test_var_3] |
| 141 | 60_errors_and_warnings.c:278: error: incompatible types for redefinition of 'xxx' | 144 | 60_errors_and_warnings.c:282: error: incompatible types for redefinition of 'xxx' |
| 142 | 145 | ||
| 143 | [test_var_4] | 146 | [test_var_4] |