| author | |
| committer | |
| log | ad2be71514adb5f46176c80d6376e74df5f93c93 |
| tree | 719f4b16b035d7911edde5f70d967ba9fb44280f |
| parent | fefcdc56735744efaa53d26adc44b2c4ab1c8abb |
| signature |
Closes #22052.4 files changed, 54 insertions(+), 0 deletions(-)
test/cases/pic_freestanding.zig created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | const builtin = @import("builtin"); | |
| 2 | const std = @import("std"); | |
| 3 | ||
| 4 | fn _start() callconv(.naked) void {} | |
| 5 | ||
| 6 | comptime { | |
| 7 | @export(&_start, .{ .name = if (builtin.cpu.arch.isMIPS()) "__start" else "_start" }); | |
| 8 | } | |
| 9 | ||
| 10 | // compile | |
| 11 | // backend=stage2,llvm | |
| 12 | // target=arm-freestanding,armeb-freestanding,thumb-freestanding,thumbeb-freestanding,aarch64-freestanding,aarch64_be-freestanding,loongarch64-freestanding,mips-freestanding,mipsel-freestanding,mips64-freestanding,mips64el-freestanding,powerpc-freestanding,powerpcle-freestanding,powerpc64-freestanding,powerpc64le-freestanding,riscv32-freestanding,riscv64-freestanding,s390x-freestanding,x86-freestanding,x86_64-freestanding | |
| 13 | // pic=true | |
| 14 | // output_mode=Exe |
test/cases/pic_linux.zig created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | // Eventually, this test should be made to work without libc by providing our | |
| 4 | // own `__tls_get_addr` implementation. powerpcle-linux should be added to the | |
| 5 | // target list here when that happens. | |
| 6 | // | |
| 7 | // https://github.com/ziglang/zig/issues/20625 | |
| 8 | pub fn main() void {} | |
| 9 | ||
| 10 | // run | |
| 11 | // backend=stage2,llvm | |
| 12 | // target=arm-linux,armeb-linux,thumb-linux,thumbeb-linux,aarch64-linux,aarch64_be-linux,loongarch64-linux,mips-linux,mipsel-linux,mips64-linux,mips64el-linux,powerpc-linux,powerpc64-linux,powerpc64le-linux,riscv32-linux,riscv64-linux,s390x-linux,x86-linux,x86_64-linux | |
| 13 | // pic=true | |
| 14 | // link_libc=true |
test/cases/pie_freestanding.zig created+16| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | const builtin = @import("builtin"); | |
| 2 | const std = @import("std"); | |
| 3 | ||
| 4 | // The self-hosted backends currently output a bunch of bad relocations for PIE, | |
| 5 | // so this test is LLVM only for now. | |
| 6 | fn _start() callconv(.naked) void {} | |
| 7 | ||
| 8 | comptime { | |
| 9 | @export(&_start, .{ .name = if (builtin.cpu.arch.isMIPS()) "__start" else "_start" }); | |
| 10 | } | |
| 11 | ||
| 12 | // compile | |
| 13 | // backend=llvm | |
| 14 | // target=arm-freestanding,armeb-freestanding,thumb-freestanding,thumbeb-freestanding,aarch64-freestanding,aarch64_be-freestanding,loongarch64-freestanding,mips-freestanding,mipsel-freestanding,mips64-freestanding,mips64el-freestanding,powerpc-freestanding,powerpcle-freestanding,powerpc64-freestanding,powerpc64le-freestanding,riscv32-freestanding,riscv64-freestanding,s390x-freestanding,x86-freestanding,x86_64-freestanding | |
| 15 | // pie=true | |
| 16 | // output_mode=Exe |
test/cases/pie_linux.zig created+10| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | // The self-hosted backends can't handle `.hidden _DYNAMIC` and `.weak _DYNAMIC` | |
| 4 | // directives in inline assembly yet, so this test is LLVM only for now. | |
| 5 | pub fn main() void {} | |
| 6 | ||
| 7 | // run | |
| 8 | // backend=llvm | |
| 9 | // target=arm-linux,armeb-linux,thumb-linux,thumbeb-linux,aarch64-linux,aarch64_be-linux,loongarch64-linux,mips-linux,mipsel-linux,mips64-linux,mips64el-linux,powerpc-linux,powerpcle-linux,powerpc64-linux,powerpc64le-linux,riscv32-linux,riscv64-linux,s390x-linux,x86-linux,x86_64-linux | |
| 10 | // pie=true |