mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
test: remove pie test case from test-standalone
We already have test/cases/pie_linux.zig covering this.
This commit is contained in:
parent
459ad8c8e6
commit
212715f62d
@ -139,9 +139,6 @@
|
|||||||
.c_embed_path = .{
|
.c_embed_path = .{
|
||||||
.path = "c_embed_path",
|
.path = "c_embed_path",
|
||||||
},
|
},
|
||||||
.pie = .{
|
|
||||||
.path = "pie",
|
|
||||||
},
|
|
||||||
.issue_12706 = .{
|
.issue_12706 = .{
|
||||||
.path = "issue_12706",
|
.path = "issue_12706",
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
const std = @import("std");
|
|
||||||
|
|
||||||
pub fn build(b: *std.Build) void {
|
|
||||||
const test_step = b.step("test", "Test it");
|
|
||||||
b.default_step = test_step;
|
|
||||||
|
|
||||||
const optimize: std.builtin.OptimizeMode = .Debug;
|
|
||||||
const target = b.resolveTargetQuery(.{
|
|
||||||
.os_tag = .linux,
|
|
||||||
.cpu_arch = .x86_64,
|
|
||||||
});
|
|
||||||
|
|
||||||
const main = b.addTest(.{
|
|
||||||
.root_module = b.createModule(.{
|
|
||||||
.root_source_file = b.path("main.zig"),
|
|
||||||
.optimize = optimize,
|
|
||||||
.target = target,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
main.pie = true;
|
|
||||||
|
|
||||||
const run = b.addRunArtifact(main);
|
|
||||||
run.skip_foreign_checks = true;
|
|
||||||
|
|
||||||
test_step.dependOn(&run.step);
|
|
||||||
}
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
const std = @import("std");
|
|
||||||
const elf = std.elf;
|
|
||||||
|
|
||||||
threadlocal var foo: u8 = 42;
|
|
||||||
|
|
||||||
test "Check ELF header" {
|
|
||||||
// PIE executables are marked as ET_DYN, regular exes as ET_EXEC.
|
|
||||||
const header = @as(*elf.Ehdr, @ptrFromInt(std.process.getBaseAddress()));
|
|
||||||
try std.testing.expectEqual(elf.ET.DYN, header.e_type);
|
|
||||||
}
|
|
||||||
|
|
||||||
test "TLS is initialized" {
|
|
||||||
// Ensure the TLS is initialized by the startup code.
|
|
||||||
try std.testing.expectEqual(@as(u8, 42), foo);
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user