| author | |
| committer | |
| log | 7dc6900018f78d7514926853d35087d5b205109f |
| tree | d8d1551697e2ad683f0f1735a43b065d5c8e102d |
| parent | 7bb323c0ebfbc2ebc6c327328c3cc249b495e3dc |
7 files changed, 0 insertions(+), 129 deletions(-)
test/link.zig-8| ... | ... | @@ -111,18 +111,10 @@ pub const cases = [_]Case{ |
| 111 | 111 | .build_root = "test/link/macho/linksection", |
| 112 | 112 | .import = @import("link/macho/linksection/build.zig"), |
| 113 | 113 | }, |
| 114 | .{ | |
| 115 | .build_root = "test/link/macho/objc", | |
| 116 | .import = @import("link/macho/objc/build.zig"), | |
| 117 | }, | |
| 118 | 114 | .{ |
| 119 | 115 | .build_root = "test/link/macho/objcpp", |
| 120 | 116 | .import = @import("link/macho/objcpp/build.zig"), |
| 121 | 117 | }, |
| 122 | .{ | |
| 123 | .build_root = "test/link/macho/pagezero", | |
| 124 | .import = @import("link/macho/pagezero/build.zig"), | |
| 125 | }, | |
| 126 | 118 | .{ |
| 127 | 119 | .build_root = "test/link/macho/reexports", |
| 128 | 120 | .import = @import("link/macho/reexports/build.zig"), |
test/link/macho/objc/Foo.h deleted-7| ... | ... | @@ -1,7 +0,0 @@ |
| 1 | #import <Foundation/Foundation.h> | |
| 2 | ||
| 3 | @interface Foo : NSObject | |
| 4 | ||
| 5 | - (NSString *)name; | |
| 6 | ||
| 7 | @end |
test/link/macho/objc/Foo.m deleted-11| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | #import "Foo.h" | |
| 2 | ||
| 3 | @implementation Foo | |
| 4 | ||
| 5 | - (NSString *)name | |
| 6 | { | |
| 7 | NSString *str = [[NSString alloc] initWithFormat:@"Zig"]; | |
| 8 | return str; | |
| 9 | } | |
| 10 | ||
| 11 | @end |
test/link/macho/objc/build.zig deleted-34| ... | ... | @@ -1,34 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | pub const requires_symlinks = true; | |
| 4 | pub const requires_macos_sdk = true; | |
| 5 | ||
| 6 | pub fn build(b: *std.Build) void { | |
| 7 | const test_step = b.step("test", "Test it"); | |
| 8 | b.default_step = test_step; | |
| 9 | ||
| 10 | add(b, test_step, .Debug); | |
| 11 | add(b, test_step, .ReleaseFast); | |
| 12 | add(b, test_step, .ReleaseSmall); | |
| 13 | add(b, test_step, .ReleaseSafe); | |
| 14 | } | |
| 15 | ||
| 16 | fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void { | |
| 17 | const exe = b.addExecutable(.{ | |
| 18 | .name = "test", | |
| 19 | .optimize = optimize, | |
| 20 | .target = b.host, | |
| 21 | }); | |
| 22 | exe.addIncludePath(.{ .path = "." }); | |
| 23 | exe.addCSourceFile(.{ .file = .{ .path = "Foo.m" }, .flags = &[0][]const u8{} }); | |
| 24 | exe.addCSourceFile(.{ .file = .{ .path = "test.m" }, .flags = &[0][]const u8{} }); | |
| 25 | exe.linkLibC(); | |
| 26 | // TODO when we figure out how to ship framework stubs for cross-compilation, | |
| 27 | // populate paths to the sysroot here. | |
| 28 | exe.linkFramework("Foundation"); | |
| 29 | ||
| 30 | const run_cmd = b.addRunArtifact(exe); | |
| 31 | run_cmd.skip_foreign_checks = true; | |
| 32 | run_cmd.expectStdOutEqual(""); | |
| 33 | test_step.dependOn(&run_cmd.step); | |
| 34 | } |
test/link/macho/objc/test.m deleted-12| ... | ... | @@ -1,12 +0,0 @@ |
| 1 | #import "Foo.h" | |
| 2 | #import <assert.h> | |
| 3 | ||
| 4 | int main(int argc, char *argv[]) | |
| 5 | { | |
| 6 | @autoreleasepool { | |
| 7 | Foo *foo = [[Foo alloc] init]; | |
| 8 | NSString *result = [foo name]; | |
| 9 | assert([result isEqualToString:@"Zig"]); | |
| 10 | return 0; | |
| 11 | } | |
| 12 | } |
test/link/macho/pagezero/build.zig deleted-54| ... | ... | @@ -1,54 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | pub const requires_symlinks = true; | |
| 4 | ||
| 5 | pub fn build(b: *std.Build) void { | |
| 6 | const test_step = b.step("test", "Test it"); | |
| 7 | b.default_step = test_step; | |
| 8 | ||
| 9 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 10 | const target = b.resolveTargetQuery(.{ .os_tag = .macos }); | |
| 11 | ||
| 12 | { | |
| 13 | const exe = b.addExecutable(.{ | |
| 14 | .name = "pagezero", | |
| 15 | .optimize = optimize, | |
| 16 | .target = target, | |
| 17 | }); | |
| 18 | exe.addCSourceFile(.{ .file = .{ .path = "main.c" }, .flags = &.{} }); | |
| 19 | exe.linkLibC(); | |
| 20 | exe.pagezero_size = 0x4000; | |
| 21 | ||
| 22 | const check = exe.checkObject(); | |
| 23 | check.checkInHeaders(); | |
| 24 | check.checkExact("LC 0"); | |
| 25 | check.checkExact("segname __PAGEZERO"); | |
| 26 | check.checkExact("vmaddr 0"); | |
| 27 | check.checkExact("vmsize 4000"); | |
| 28 | ||
| 29 | check.checkInHeaders(); | |
| 30 | check.checkExact("segname __TEXT"); | |
| 31 | check.checkExact("vmaddr 4000"); | |
| 32 | ||
| 33 | test_step.dependOn(&check.step); | |
| 34 | } | |
| 35 | ||
| 36 | { | |
| 37 | const exe = b.addExecutable(.{ | |
| 38 | .name = "no_pagezero", | |
| 39 | .optimize = optimize, | |
| 40 | .target = target, | |
| 41 | }); | |
| 42 | exe.addCSourceFile(.{ .file = .{ .path = "main.c" }, .flags = &.{} }); | |
| 43 | exe.linkLibC(); | |
| 44 | exe.pagezero_size = 0; | |
| 45 | ||
| 46 | const check = exe.checkObject(); | |
| 47 | check.checkInHeaders(); | |
| 48 | check.checkExact("LC 0"); | |
| 49 | check.checkExact("segname __TEXT"); | |
| 50 | check.checkExact("vmaddr 0"); | |
| 51 | ||
| 52 | test_step.dependOn(&check.step); | |
| 53 | } | |
| 54 | } |
test/link/macho/pagezero/main.c deleted-3| ... | ... | @@ -1,3 +0,0 @@ |
| 1 | int main(int argc, char* argv[]) { | |
| 2 | return 0; | |
| 3 | } |