aboutsummaryrefslogtreecommitdiff
path: root/test/cases/pie_freestanding.zig
blob: 9a86ddbc4289a2a98ee168311694277f99f92814 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const builtin = @import("builtin");
const std = @import("std");

// The self-hosted backends currently output a bunch of bad relocations for PIE,
// so this test is LLVM only for now.
fn _start() callconv(.naked) void {}

comptime {
    @export(&_start, .{ .name = if (builtin.cpu.arch.isMIPS()) "__start" else "_start" });
}

// compile
// backend=llvm
// 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
// pie=true
// output_mode=Exe