| ... | @@ -2204,25 +2204,28 @@ fn testThunks(b: *Build, opts: Options) *Step { | ... | @@ -2204,25 +2204,28 @@ fn testThunks(b: *Build, opts: Options) *Step { |
| 2204 | | 2204 | |
| 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 | }); |
| 2222 | | 2219 | |
| | 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); |
| 2227 | | 2230 | |
| 2228 | return test_step; | 2231 | return test_step; |