| 1 | const std = @import("std"); |
| 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { |
| 4 | _ = stack_trace; |
| 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | std.process.exit(0); |
| 7 | } |
| 8 | std.process.exit(1); |
| 9 | } |
| 10 | pub fn main() !void { |
| 11 | const a: @Vector(4, u8) = [_]u8{ 1, 2, 200, 4 }; |
| 12 | const b: @Vector(4, u8) = [_]u8{ 5, 6, 2, 8 }; |
| 13 | const x = mul(b, a); |
| 14 | _ = x; |
| 15 | return error.TestFailed; |
| 16 | } |
| 17 | fn mul(a: @Vector(4, u8), b: @Vector(4, u8)) @Vector(4, u8) { |
| 18 | return a * b; |
| 19 | } |
| 20 | // run |
| 21 | // backend=selfhosted,llvm |
| 22 | // target=x86_64-linux,wasm32-wasi |