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 {
22042204
22052205 const exe = addExecutable(b, opts, .{ .name = "main", .c_source_bytes =
22062206 \\#include <stdio.h>
2207 \\__attribute__((aligned(0x8000000))) int bar() {
2208 \\ return 42;
2207 \\void bar() {
2208 \\ printf("bar");
22092209 \\}
2210 \\int foobar();
2211 \\int foo() {
2212 \\ return bar() - foobar();
2213 \\}
2214 \\__attribute__((aligned(0x8000000))) int foobar() {
2215 \\ return 42;
2210 \\void foo() {
2211 \\ fprintf(stdout, "foo");
22162212 \\}
22172213 \\int main() {
2218 \\ printf("bar=%d, foo=%d, foobar=%d", bar(), foo(), foobar());
2219 \\ return foo();
2214 \\ foo();
2215 \\ bar();
2216 \\ return 0;
22202217 \\}
22212218 });
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
22232227 const run = addRunArtifact(exe);
2224 run.expectStdOutEqual("bar=42, foo=0, foobar=42");
2225 run.expectExitCode(0);
2228 run.expectStdOutEqual("foobar");
22262229 test_step.dependOn(&run.step);
22272230
22282231 return test_step;