| ... | ... | @@ -2204,25 +2204,28 @@ fn testThunks(b: *Build, opts: Options) *Step { |
| 2204 | 2204 | |
| 2205 | 2205 | const exe = addExecutable(b, opts, .{ .name = "main", .c_source_bytes = |
| 2206 | 2206 | \\#include <stdio.h> |
| 2207 | | \\__attribute__((aligned(0x8000000))) int bar() { |
| 2208 | | \\ return 42; |
| 2207 | \\void bar() { |
| 2208 | \\ printf("bar"); |
| 2209 | 2209 | \\} |
| 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"); |
| 2216 | 2212 | \\} |
| 2217 | 2213 | \\int main() { |
| 2218 | | \\ printf("bar=%d, foo=%d, foobar=%d", bar(), foo(), foobar()); |
| 2219 | | \\ return foo(); |
| 2214 | \\ 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 | 2227 | const run = addRunArtifact(exe); |
| 2224 | | run.expectStdOutEqual("bar=42, foo=0, foobar=42"); |
| 2225 | | run.expectExitCode(0); |
| 2228 | run.expectStdOutEqual("foobar"); |
| 2226 | 2229 | test_step.dependOn(&run.step); |
| 2227 | 2230 | |
| 2228 | 2231 | return test_step; |