| ... | ... | @@ -228,6 +228,27 @@ pub inline fn __builtin_isinf_sign(x: anytype) c_int { |
| 228 | 228 | return if (std.math.isPositiveInf(x)) 1 else -1; |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | pub inline fn __has_builtin(func: anytype) c_int { |
| 232 | _ = func; |
| 233 | return @boolToInt(true); |
| 234 | } |
| 235 | |
| 236 | pub inline fn __builtin_assume(cond: bool) void { |
| 237 | if (!cond) unreachable; |
| 238 | } |
| 239 | |
| 240 | pub inline fn __builtin_unreachable() noreturn { |
| 241 | unreachable; |
| 242 | } |
| 243 | |
| 244 | pub inline fn __builtin_constant_p(expr: anytype) c_int { |
| 245 | _ = expr; |
| 246 | return @boolToInt(false); |
| 247 | } |
| 248 | pub fn __builtin_mul_overflow(a: anytype, b: anytype, result: *@TypeOf(a, b)) c_int { |
| 249 | return @boolToInt(@mulWithOverflow(@TypeOf(a, b), a, b, result)); |
| 250 | } |
| 251 | |
| 231 | 252 | // __builtin_alloca_with_align is not currently implemented. |
| 232 | 253 | // It is used in a run-translated-c test and a test-translate-c test to ensure that non-implemented |
| 233 | 254 | // builtins are correctly demoted. If you implement __builtin_alloca_with_align, please update the |