aboutsummaryrefslogtreecommitdiff
path: root/test/link/macho
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2024-01-15 12:05:26 +0100
committerJakub Konka <kubkon@jakubkonka.com>2024-01-24 12:34:40 +0100
commit2b3ac3e82f4207981469739b4ecd9fa0c3ac3308 (patch)
tree92d69521c967826a29b78d0a1302eb0eeff22f99 /test/link/macho
parenta3f68c6fa23f893597b7708e0c00e81f57cb35c1 (diff)
downloadzig-2b3ac3e82f4207981469739b4ecd9fa0c3ac3308.tar.gz
zig-2b3ac3e82f4207981469739b4ecd9fa0c3ac3308.zip
test/link/macho: upgrade tbdv3 test
Diffstat (limited to 'test/link/macho')
-rw-r--r--test/link/macho/tbdv3/a.c3
-rw-r--r--test/link/macho/tbdv3/build.zig57
-rw-r--r--test/link/macho/tbdv3/main.c7
3 files changed, 0 insertions, 67 deletions
diff --git a/test/link/macho/tbdv3/a.c b/test/link/macho/tbdv3/a.c
deleted file mode 100644
index ddd18ee4b6..0000000000
--- a/test/link/macho/tbdv3/a.c
+++ /dev/null
@@ -1,3 +0,0 @@
-int getFoo() {
- return 42;
-}
diff --git a/test/link/macho/tbdv3/build.zig b/test/link/macho/tbdv3/build.zig
deleted file mode 100644
index 547f72c25f..0000000000
--- a/test/link/macho/tbdv3/build.zig
+++ /dev/null
@@ -1,57 +0,0 @@
-const std = @import("std");
-const builtin = @import("builtin");
-
-pub const requires_symlinks = true;
-pub const requires_macos_sdk = false;
-
-pub fn build(b: *std.Build) void {
- const test_step = b.step("test", "Test it");
- b.default_step = test_step;
-
- add(b, test_step, .Debug);
- add(b, test_step, .ReleaseFast);
- add(b, test_step, .ReleaseSmall);
- add(b, test_step, .ReleaseSafe);
-}
-
-fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void {
- const target = b.resolveTargetQuery(.{ .os_tag = .macos });
-
- const lib = b.addSharedLibrary(.{
- .name = "a",
- .version = .{ .major = 1, .minor = 0, .patch = 0 },
- .optimize = optimize,
- .target = target,
- });
- lib.addCSourceFile(.{ .file = .{ .path = "a.c" }, .flags = &.{} });
- lib.linkLibC();
-
- const tbd_file = b.addWriteFile("liba.tbd",
- \\--- !tapi-tbd-v3
- \\archs: [ arm64, x86_64 ]
- \\uuids: [ 'arm64: DEADBEEF', 'x86_64: BEEFDEAD' ]
- \\platform: macos
- \\install-name: @rpath/liba.dylib
- \\current-version: 0
- \\exports:
- \\ - archs: [ arm64, x86_64 ]
- \\ symbols: [ _getFoo ]
- );
-
- const exe = b.addExecutable(.{
- .name = "test",
- .optimize = optimize,
- .target = target,
- });
- exe.addCSourceFile(.{ .file = .{ .path = "main.c" }, .flags = &[0][]const u8{} });
- exe.linkSystemLibrary("a");
- exe.addLibraryPath(tbd_file.getDirectory());
- exe.addRPath(lib.getEmittedBinDirectory());
- exe.linkLibC();
-
- const run = b.addRunArtifact(exe);
- run.skip_foreign_checks = true;
- run.expectExitCode(0);
-
- test_step.dependOn(&run.step);
-}
diff --git a/test/link/macho/tbdv3/main.c b/test/link/macho/tbdv3/main.c
deleted file mode 100644
index 3cf37ae590..0000000000
--- a/test/link/macho/tbdv3/main.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int getFoo();
-
-int main() {
- return getFoo() - 42;
-}