| ... | ... | @@ -61,6 +61,7 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step { |
| 61 | 61 | elf_step.dependOn(testAbsSymbols(b, .{ .target = musl_target })); |
| 62 | 62 | elf_step.dependOn(testCommonSymbols(b, .{ .target = musl_target })); |
| 63 | 63 | elf_step.dependOn(testCommonSymbolsInArchive(b, .{ .target = musl_target })); |
| 64 | elf_step.dependOn(testCommentString(b, .{ .target = musl_target })); |
| 64 | 65 | elf_step.dependOn(testEmptyObject(b, .{ .target = musl_target })); |
| 65 | 66 | elf_step.dependOn(testEntryPoint(b, .{ .target = musl_target })); |
| 66 | 67 | elf_step.dependOn(testGcSections(b, .{ .target = musl_target })); |
| ... | ... | @@ -83,6 +84,7 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step { |
| 83 | 84 | elf_step.dependOn(testAsNeeded(b, .{ .target = gnu_target })); |
| 84 | 85 | // https://github.com/ziglang/zig/issues/17430 |
| 85 | 86 | // elf_step.dependOn(testCanonicalPlt(b, .{ .target = gnu_target })); |
| 87 | elf_step.dependOn(testCommentString(b, .{ .target = gnu_target })); |
| 86 | 88 | elf_step.dependOn(testCopyrel(b, .{ .target = gnu_target })); |
| 87 | 89 | // https://github.com/ziglang/zig/issues/17430 |
| 88 | 90 | // elf_step.dependOn(testCopyrelAlias(b, .{ .target = gnu_target })); |
| ... | ... | @@ -154,6 +156,8 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step { |
| 154 | 156 | elf_step.dependOn(testThunks(b, .{ .target = aarch64_musl })); |
| 155 | 157 | |
| 156 | 158 | // x86_64 self-hosted backend |
| 159 | elf_step.dependOn(testCommentString(b, .{ .use_llvm = false, .target = default_target })); |
| 160 | elf_step.dependOn(testCommentStringStaticLib(b, .{ .use_llvm = false, .target = default_target })); |
| 157 | 161 | elf_step.dependOn(testEmitRelocatable(b, .{ .use_llvm = false, .target = x86_64_musl })); |
| 158 | 162 | elf_step.dependOn(testEmitStaticLibZig(b, .{ .use_llvm = false, .target = x86_64_musl })); |
| 159 | 163 | elf_step.dependOn(testGcSectionsZig(b, .{ .use_llvm = false, .target = default_target })); |
| ... | ... | @@ -364,6 +368,36 @@ fn testCanonicalPlt(b: *Build, opts: Options) *Step { |
| 364 | 368 | return test_step; |
| 365 | 369 | } |
| 366 | 370 | |
| 371 | fn testCommentString(b: *Build, opts: Options) *Step { |
| 372 | const test_step = addTestStep(b, "comment-string", opts); |
| 373 | |
| 374 | const exe = addExecutable(b, opts, .{ .name = "main", .zig_source_bytes = |
| 375 | \\pub fn main() void {} |
| 376 | }); |
| 377 | |
| 378 | const check = exe.checkObject(); |
| 379 | check.dumpSection(".comment"); |
| 380 | check.checkContains("zig"); |
| 381 | test_step.dependOn(&check.step); |
| 382 | |
| 383 | return test_step; |
| 384 | } |
| 385 | |
| 386 | fn testCommentStringStaticLib(b: *Build, opts: Options) *Step { |
| 387 | const test_step = addTestStep(b, "comment-string-static-lib", opts); |
| 388 | |
| 389 | const lib = addStaticLibrary(b, opts, .{ .name = "lib", .zig_source_bytes = |
| 390 | \\export fn foo() void {} |
| 391 | }); |
| 392 | |
| 393 | const check = lib.checkObject(); |
| 394 | check.dumpSection(".comment"); |
| 395 | check.checkContains("zig"); |
| 396 | test_step.dependOn(&check.step); |
| 397 | |
| 398 | return test_step; |
| 399 | } |
| 400 | |
| 367 | 401 | fn testCommonSymbols(b: *Build, opts: Options) *Step { |
| 368 | 402 | const test_step = addTestStep(b, "common-symbols", opts); |
| 369 | 403 | |