$ clang -c test.c -fsanitize=fuzzer-no-link -S -emit-llvm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const builtin = @import("builtin"); | |
| const std = @import("std"); | |
| const Io = std.Io; | |
| // Open two netcat instances and make them listen to these ports | |
| const recv1_addr = Io.net.IpAddress.parseIp4("127.0.0.1", 1993) catch unreachable; | |
| const recv2_addr = Io.net.IpAddress.parseIp4("127.0.0.1", 1994) catch unreachable; | |
| const addresses: [2]Io.net.IpAddress = .{ recv1_addr, recv2_addr }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDpCHl0686CO6U1HrAdDFri/N3yuNcJsfjOpXoemGOWUWpmOKiMQ24DOPxHV24H18yGtnzBlxLjw+SoTpT+0aekXMAK6r6K79dhctnUgPsxON/JmqPnag8sdrNo46d0XnCoEK2Sty3Q3GJMgtcbqsJXtwxy4h9Fv3TMVHz+NwmonEbReSM3c/jLMSZFfBXH9gUjosZ5kGtOm8DrtAxA7+YmaKYudHge1Xo/Isz+/aPHl8c5y29HKmC3PsaHP1wVBfzHEpyIdcFpNmVsD+Zu8ySeV+7zaVYPYuBB3alQHuvkjXdi5UlZVehV+FmFwFVsrQ8V1TkCvnGUWlz1PA2topZGFZ3AKRfbhG1e0mgqi8mZyN6oKDofgEJW+t3luism6c9n/PFayVePi2jLLpW0qnMpFoNeLwZp50qxRkZjLE7gZ6LeGNYj9uH11YnYEXaV3TxH5bXvlLr0DU/flsMdd5t1jq0JeluAw/k7dSHrz3/IBlS+ubdOwhdMnXk01jSUV4c= andy@Andrews-MBP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const std = @import("std"); | |
| const Allocator = std.mem.Allocator; | |
| const Io = std.Io; | |
| pub const std_options: std.Options = .{ | |
| .log_level = .info, | |
| }; | |
| pub fn main() !void { | |
| var debug_allocator: std.heap.DebugAllocator(.{}) = .init; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pub const GlobalVec = UniqueVec(.global); | |
| pub const LocalVec = UniqueVec(.local); | |
| pub const Tag = enum {global,local}; | |
| fn UniqueVec(tag: Tag) type { | |
| return struct { | |
| pub const tag = Tag; | |
| pub fn add(...) @This() { ... } | |
| pub fn sub(...) @This() { ... } | |
| // ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with import <nixpkgs> {}; { | |
| tmpAoeu = stdenv.mkDerivation { | |
| name = "zig-no-llvm"; | |
| hardeningDisable = [ "all" ]; | |
| buildInputs = [ | |
| cmake | |
| ninja | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| andy@bark ~/d/z/build-release (master) [1]> stage3/bin/zig build-obj test.zig -target avr-freestanding -OReleaseFast | |
| andy@bark ~/d/z/build-release (master)> ~/local/llvm20-assert/bin/llvm-objdump -d test.o | |
| test.o: file format elf32-avr | |
| Disassembly of section .text: | |
| 00000000 <example>: | |
| 0: 6f 92 7f 92 <unknown> | |
| 4: 8f 92 9f 92 <unknown> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const std = @import("std"); | |
| const assert = std.debug.assert; | |
| const Allocator = std.mem.Allocator; | |
| const Io = std.Io; | |
| pub fn main() !void { | |
| var debug_allocator: std.heap.DebugAllocator(.{}) = .init; | |
| const gpa = debug_allocator.allocator(); | |
| //const gpa = std.heap.smp_allocator; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const State = struct { | |
| clowns: StringHashMap(Clown) = .empty, | |
| const Clown = struct { | |
| scariness: f32, | |
| funniness: f32, | |
| }; | |
| fn deinit(state: *State, gpa: Allocator) void { | |
| var it = state.clowns.iterator(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const std = @import("std"); | |
| const Allocator = std.mem.Allocator; | |
| var debug_allocator: std.heap.DebugAllocator(.{ | |
| .safety = false, | |
| .stack_trace_frames = 0, | |
| }) = .init; | |
| pub fn main() !void { | |
| //const gpa = debug_allocator.allocator(); |
NewerOlder