diff --git a/test/link.zig b/test/link.zig index 905d6cc35d..4fb90000ab 100644 --- a/test/link.zig +++ b/test/link.zig @@ -111,18 +111,10 @@ pub const cases = [_]Case{ .build_root = "test/link/macho/linksection", .import = @import("link/macho/linksection/build.zig"), }, - .{ - .build_root = "test/link/macho/objc", - .import = @import("link/macho/objc/build.zig"), - }, .{ .build_root = "test/link/macho/objcpp", .import = @import("link/macho/objcpp/build.zig"), }, - .{ - .build_root = "test/link/macho/pagezero", - .import = @import("link/macho/pagezero/build.zig"), - }, .{ .build_root = "test/link/macho/reexports", .import = @import("link/macho/reexports/build.zig"), diff --git a/test/link/macho/objc/Foo.h b/test/link/macho/objc/Foo.h deleted file mode 100644 index 05cb7df39b..0000000000 --- a/test/link/macho/objc/Foo.h +++ /dev/null @@ -1,7 +0,0 @@ -#import - -@interface Foo : NSObject - -- (NSString *)name; - -@end diff --git a/test/link/macho/objc/Foo.m b/test/link/macho/objc/Foo.m deleted file mode 100644 index 6fc9b1edf0..0000000000 --- a/test/link/macho/objc/Foo.m +++ /dev/null @@ -1,11 +0,0 @@ -#import "Foo.h" - -@implementation Foo - -- (NSString *)name -{ - NSString *str = [[NSString alloc] initWithFormat:@"Zig"]; - return str; -} - -@end diff --git a/test/link/macho/objc/build.zig b/test/link/macho/objc/build.zig deleted file mode 100644 index 26bbdc2673..0000000000 --- a/test/link/macho/objc/build.zig +++ /dev/null @@ -1,34 +0,0 @@ -const std = @import("std"); - -pub const requires_symlinks = true; -pub const requires_macos_sdk = true; - -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 exe = b.addExecutable(.{ - .name = "test", - .optimize = optimize, - .target = b.host, - }); - exe.addIncludePath(.{ .path = "." }); - exe.addCSourceFile(.{ .file = .{ .path = "Foo.m" }, .flags = &[0][]const u8{} }); - exe.addCSourceFile(.{ .file = .{ .path = "test.m" }, .flags = &[0][]const u8{} }); - exe.linkLibC(); - // TODO when we figure out how to ship framework stubs for cross-compilation, - // populate paths to the sysroot here. - exe.linkFramework("Foundation"); - - const run_cmd = b.addRunArtifact(exe); - run_cmd.skip_foreign_checks = true; - run_cmd.expectStdOutEqual(""); - test_step.dependOn(&run_cmd.step); -} diff --git a/test/link/macho/objc/test.m b/test/link/macho/objc/test.m deleted file mode 100644 index 3c81316788..0000000000 --- a/test/link/macho/objc/test.m +++ /dev/null @@ -1,12 +0,0 @@ -#import "Foo.h" -#import - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - Foo *foo = [[Foo alloc] init]; - NSString *result = [foo name]; - assert([result isEqualToString:@"Zig"]); - return 0; - } -} diff --git a/test/link/macho/pagezero/build.zig b/test/link/macho/pagezero/build.zig deleted file mode 100644 index cee2aa9fd5..0000000000 --- a/test/link/macho/pagezero/build.zig +++ /dev/null @@ -1,54 +0,0 @@ -const std = @import("std"); - -pub const requires_symlinks = true; - -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 = .macos }); - - { - const exe = b.addExecutable(.{ - .name = "pagezero", - .optimize = optimize, - .target = target, - }); - exe.addCSourceFile(.{ .file = .{ .path = "main.c" }, .flags = &.{} }); - exe.linkLibC(); - exe.pagezero_size = 0x4000; - - const check = exe.checkObject(); - check.checkInHeaders(); - check.checkExact("LC 0"); - check.checkExact("segname __PAGEZERO"); - check.checkExact("vmaddr 0"); - check.checkExact("vmsize 4000"); - - check.checkInHeaders(); - check.checkExact("segname __TEXT"); - check.checkExact("vmaddr 4000"); - - test_step.dependOn(&check.step); - } - - { - const exe = b.addExecutable(.{ - .name = "no_pagezero", - .optimize = optimize, - .target = target, - }); - exe.addCSourceFile(.{ .file = .{ .path = "main.c" }, .flags = &.{} }); - exe.linkLibC(); - exe.pagezero_size = 0; - - const check = exe.checkObject(); - check.checkInHeaders(); - check.checkExact("LC 0"); - check.checkExact("segname __TEXT"); - check.checkExact("vmaddr 0"); - - test_step.dependOn(&check.step); - } -} diff --git a/test/link/macho/pagezero/main.c b/test/link/macho/pagezero/main.c deleted file mode 100644 index ca68d24cc7..0000000000 --- a/test/link/macho/pagezero/main.c +++ /dev/null @@ -1,3 +0,0 @@ -int main(int argc, char* argv[]) { - return 0; -}