| author | |
| committer | |
| log | 8b9627f01d44b94fad744f6d515dc32438130628 |
| tree | f6e84217af1abced5e910ea3a6d83e4f06ad68b7 |
| parent | 78449b6d980fc78d418f9b44d815781eda7587f7 |
build: fix CheckObject checkNotPresent only checking a single line of the haystack4 files changed, 42 insertions(+), 2 deletions(-)
lib/std/Build/Step/CheckObject.zig+1-2| ... | ... | @@ -478,8 +478,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 478 | 478 | }, |
| 479 | 479 | .not_present => { |
| 480 | 480 | while (it.next()) |line| { |
| 481 | if (act.notPresent(b, step, line)) break; | |
| 482 | } else { | |
| 481 | if (act.notPresent(b, step, line)) continue; | |
| 483 | 482 | return step.fail( |
| 484 | 483 | \\ |
| 485 | 484 | \\========= expected not to find: =================== |
test/standalone.zig+4| ... | ... | @@ -241,6 +241,10 @@ pub const build_cases = [_]BuildCase{ |
| 241 | 241 | .build_root = "test/standalone/coff_dwarf", |
| 242 | 242 | .import = @import("standalone/coff_dwarf/build.zig"), |
| 243 | 243 | }, |
| 244 | .{ | |
| 245 | .build_root = "test/standalone/compiler_rt_panic", | |
| 246 | .import = @import("standalone/compiler_rt_panic/build.zig"), | |
| 247 | }, | |
| 244 | 248 | }; |
| 245 | 249 | |
| 246 | 250 | const std = @import("std"); |
test/standalone/compiler_rt_panic/build.zig created+26| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | pub fn build(b: *std.Build) void { | |
| 4 | const test_step = b.step("test", "Test it"); | |
| 5 | b.default_step = test_step; | |
| 6 | ||
| 7 | const target = b.standardTargetOptions(.{}); | |
| 8 | const optimize = b.standardOptimizeOption(.{}); | |
| 9 | ||
| 10 | if (target.getObjectFormat() != .elf) return; | |
| 11 | ||
| 12 | const exe = b.addExecutable(.{ | |
| 13 | .name = "main", | |
| 14 | .optimize = optimize, | |
| 15 | .target = target, | |
| 16 | }); | |
| 17 | exe.addCSourceFile("main.c", &.{}); | |
| 18 | exe.link_gc_sections = false; | |
| 19 | exe.bundle_compiler_rt = true; | |
| 20 | ||
| 21 | // Verify compiler_rt hasn't pulled in any debug handlers | |
| 22 | const check_exe = exe.checkObject(); | |
| 23 | check_exe.checkInSymtab(); | |
| 24 | check_exe.checkNotPresent("debug.readElfDebugInfo"); | |
| 25 | test_step.dependOn(&check_exe.step); | |
| 26 | } |
test/standalone/compiler_rt_panic/main.c created+11| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | #include <stddef.h> | |
| 2 | ||
| 3 | void* __memset(void* dest, char c, size_t n, size_t dest_n); | |
| 4 | ||
| 5 | char foo[128]; | |
| 6 | ||
| 7 | int main() { | |
| 8 | __memset(&foo[0], 0xff, 128, 128); | |
| 9 | return foo[64]; | |
| 10 | } | |
| 11 |