authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-08-22 00:36:47+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-08-22 00:36:47+02:00
logfa79f53f92cf41f30a84f4e8f5f059e15060ae2b
treee02127f05d4994dd4ced79c7b5a8e87afe702f4a
parentcbb80934554776eb8d4d016640572e0c7962f2be

test/macho: simplify testing range extension thunks


1 files changed, 15 insertions(+), 12 deletions(-)

test/link/macho.zig+15-12
...@@ -2204,25 +2204,28 @@ fn testThunks(b: *Build, opts: Options) *Step {...@@ -2204,25 +2204,28 @@ fn testThunks(b: *Build, opts: Options) *Step {
22042204
2205 const exe = addExecutable(b, opts, .{ .name = "main", .c_source_bytes = 2205 const exe = addExecutable(b, opts, .{ .name = "main", .c_source_bytes =
2206 \\#include <stdio.h>2206 \\#include <stdio.h>
2207 \\__attribute__((aligned(0x8000000))) int bar() {2207 \\void bar() {
2208 \\ return 42;2208 \\ printf("bar");
2209 \\}2209 \\}
2210 \\int foobar();2210 \\void foo() {
2211 \\int foo() {2211 \\ fprintf(stdout, "foo");
2212 \\ return bar() - foobar();
2213 \\}
2214 \\__attribute__((aligned(0x8000000))) int foobar() {
2215 \\ return 42;
2216 \\}2212 \\}
2217 \\int main() {2213 \\int main() {
2218 \\ printf("bar=%d, foo=%d, foobar=%d", bar(), foo(), foobar());2214 \\ foo();
2219 \\ return foo();2215 \\ bar();
2216 \\ return 0;
2220 \\}2217 \\}
2221 });2218 });
22222219
2220 const check = exe.checkObject();
2221 check.checkInSymtab();
2222 check.checkContains("_printf__thunk");
2223 check.checkInSymtab();
2224 check.checkContains("_fprintf__thunk");
2225 test_step.dependOn(&check.step);
2226
2223 const run = addRunArtifact(exe);2227 const run = addRunArtifact(exe);
2224 run.expectStdOutEqual("bar=42, foo=0, foobar=42");2228 run.expectStdOutEqual("foobar");
2225 run.expectExitCode(0);
2226 test_step.dependOn(&run.step);2229 test_step.dependOn(&run.step);
22272230
2228 return test_step;2231 return test_step;