first pass at (rdi -> loose rdim) path, used in (rdi * ... * rdi) -> rdi joining in radbin; plug in regular conversion path before voff -> line & breakpad paths in radbin, such that PDBs, DWARFs, RDIs, etc. can be used as input; fix up voff -> line path to plug into regular output systems; remove String8 union thing - three reasons: (a) it was only ever introduced for convenience in Linux layers, so let's just keep zero-terminated Linux nonsense in Linux land, (b) it was just alternate syntax for a cast, so let's just cast, (c) it was misleading - 'cstr' implies null-termination, which String8 of course doesn't guarantee. this led to some misuses, where .cstr was trusted to be zero-terminated, when that was not necessarily true (semaphore opening).

This commit is contained in:
Ryan Fleury committed 2026-03-03 16:24:54 -08:00
1 parent 2af3990971
commit 4312ee14fd
17 files changed
+1797 -1508

No files matched your search

+22 -22
View File
@@ -40,39 +40,39 @@ extern U64 g_torture_test_count;
extern T_Test g_torture_tests[0xffffff];
#define T_AddTest(name, l, ...) \
T_RunResult t_##name(void); \
__VA_ARGS__ void t_add_test_##name(void) \
{ \
g_torture_tests[g_torture_test_count].group = T_Group; \
g_torture_tests[g_torture_test_count].label = Stringify(name); \
g_torture_tests[g_torture_test_count].r = &t_##name; \
g_torture_tests[g_torture_test_count].decl_line = l; \
g_torture_test_count += 1; \
}
T_RunResult t_##name(void); \
__VA_ARGS__ void t_add_test_##name(void) \
{ \
g_torture_tests[g_torture_test_count].group = T_Group; \
g_torture_tests[g_torture_test_count].label = Stringify(name); \
g_torture_tests[g_torture_test_count].r = &t_##name; \
g_torture_tests[g_torture_test_count].decl_line = l; \
g_torture_test_count += 1; \
}
#if COMPILER_MSVC
#pragma section(".CRT$XCU", read)
# define T_BeginTest_(name) \
T_AddTest(name, __LINE__) \
__declspec(allocate(".CRT$XCU")) void(*r_##name)(void) = t_add_test_##name; \
__pragma(comment(linker, "/include:" Stringify(r_##name)))
T_AddTest(name, __LINE__) \
__declspec(allocate(".CRT$XCU")) void(*r_##name)(void) = t_add_test_##name; \
__pragma(comment(linker, "/include:" Stringify(r_##name)))
#else
# define T_BeginTest_(name) \
T_AddTest(name, __LINE__, __attribute__((constructor)))
T_AddTest(name, __LINE__, __attribute__((constructor)))
#endif
#define T_BeginTest(name) \
T_BeginTest_(name) \
T_RunResult t_##name(void) { \
Temp scratch = scratch_begin(0,0); \
T_RunResult result = { .status = T_RunStatus_Fail };
T_BeginTest_(name) \
T_RunResult t_##name(void) { \
Temp scratch = scratch_begin(0,0); \
T_RunResult result = { .status = T_RunStatus_Fail };
#define T_EndTest \
result.status = T_RunStatus_Pass; \
exit__:; \
scratch_end(scratch); \
return result; \
}
result.status = T_RunStatus_Pass; \
exit__:; \
scratch_end(scratch); \
return result; \
}
#define T_Ok(c) do { if (!(c)) { result.fail_file = __FILE__; result.fail_line = __LINE__; result.fail_cond = Stringify(c); goto exit__; } } while(0)
#define T_MatchLinef(out, ...) T_Ok(t_match_linef(out, __VA_ARGS__))