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 | 186 | _Static_assert(ONE == 0, "don't show me this"); |
| 187 | 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 | 193 | #elif defined test_void_array |
| 190 | 194 | void t[3]; |
| 191 | 195 | |
| @@ -89,24 +89,27 @@ · 88 unmodified lines | ||
| 89 | 89 | 60_errors_and_warnings.c:181: error: identifier expected |
| 90 | 90 | |
| 91 | 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 | 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 | 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 | 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 | 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 | 109 | [test_incomplete_array_array] |
| 107 | 110 | |
| 108 | 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 | 114 | [test_func_1] |
| 112 | 115 | hello: a = 123 |
| @@ -115,17 +118,17 @@ hello: a = 123 · 2 unmodified lines | ||
| 115 | 118 | hello: a = 123 |
| 116 | 119 | |
| 117 | 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 | 122 | hello: a = 123 |
| 120 | 123 | |
| 121 | 124 | [test_func_4] |
| 122 | 125 | hello: a = 123 |
| 123 | 126 | |
| 124 | 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 | 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 | 133 | [test_var_1] |
| 131 | 134 | main : 1 ; 1 |
| @@ -138,6 +141,6 @@ main : 2 ; 2 · 6 unmodified lines | ||
| 138 | 141 | bar : 3 ; 3 |
| 139 | 142 | |
| 140 | 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 | 146 | [test_var_4] |