aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2024-08-22 00:36:47 +0200
committerJakub Konka <kubkon@jakubkonka.com>2024-08-22 00:36:47 +0200
commitfa79f53f92cf41f30a84f4e8f5f059e15060ae2b (patch)
treee02127f05d4994dd4ced79c7b5a8e87afe702f4a /test
parentcbb80934554776eb8d4d016640572e0c7962f2be (diff)
downloadzig-fa79f53f92cf41f30a84f4e8f5f059e15060ae2b.tar.gz
zig-fa79f53f92cf41f30a84f4e8f5f059e15060ae2b.zip
test/macho: simplify testing range extension thunks
Diffstat (limited to 'test')
-rw-r--r--test/link/macho.zig27
1 files changed, 15 insertions, 12 deletions
diff --git a/test/link/macho.zig b/test/link/macho.zig
index 30982e6ba2..730edcf3a9 100644
--- a/test/link/macho.zig
+++ b/test/link/macho.zig
@@ -2204,25 +2204,28 @@ fn testThunks(b: *Build, opts: Options) *Step {
const exe = addExecutable(b, opts, .{ .name = "main", .c_source_bytes =
\\#include <stdio.h>
- \\__attribute__((aligned(0x8000000))) int bar() {
- \\ return 42;
+ \\void bar() {
+ \\ printf("bar");
\\}
- \\int foobar();
- \\int foo() {
- \\ return bar() - foobar();
- \\}
- \\__attribute__((aligned(0x8000000))) int foobar() {
- \\ return 42;
+ \\void foo() {
+ \\ fprintf(stdout, "foo");
\\}
\\int main() {
- \\ printf("bar=%d, foo=%d, foobar=%d", bar(), foo(), foobar());
- \\ return foo();
+ \\ foo();
+ \\ bar();
+ \\ return 0;
\\}
});
+ const check = exe.checkObject();
+ check.checkInSymtab();
+ check.checkContains("_printf__thunk");
+ check.checkInSymtab();
+ check.checkContains("_fprintf__thunk");
+ test_step.dependOn(&check.step);
+
const run = addRunArtifact(exe);
- run.expectStdOutEqual("bar=42, foo=0, foobar=42");
- run.expectExitCode(0);
+ run.expectStdOutEqual("foobar");
test_step.dependOn(&run.step);
return test_step;