@@ -916,6 +916,13 @@ pub fn build(b: *std.Build) !void {
916916 .mingw = .passes ,
917917 .wasi = .unsupported ,
918918 }, false );
919+ installTlsAlignTestCase (& libc_test , .{
920+ .darwin = .passes ,
921+ .gnu = .unstable ,
922+ .musl = .unstable ,
923+ .mingw = .passes ,
924+ .wasi = .unsupported ,
925+ }, false );
919926 installTlsAlignStaticTestCase (& libc_test , .passes , false );
920927 installSimpleTestCase (& libc_test , "functional/tls_init.c" , .{
921928 .darwin = .passes ,
@@ -2413,7 +2420,6 @@ pub fn build(b: *std.Build) !void {
24132420 installSimpleTestCase (& libc_test , "regression/wcsstr-false-negative.c" , .passes , false );
24142421
24152422 // TODO
2416- // "functional/tls_align.c"
24172423 // "functional/tls_align_dlopen.c"
24182424 // "functional/tls_align_dso.c"
24192425 // "functional/tls_init_dlopen.c"
@@ -2546,6 +2552,36 @@ fn installDlopenTestCase(libc_test: *const LibCTest, support: LibCImpl.Support,
25462552 installTestCase (libc_test , exe , .{ .run_dep = & copy_dso .step });
25472553}
25482554
2555+ fn installTlsAlignTestCase (libc_test : * const LibCTest , support : LibCImpl.Support , debug_only : bool ) void {
2556+ if (support .shouldSkip (libc_test )) return ;
2557+ if (debug_only and libc_test .optimize != .Debug ) return ;
2558+
2559+ const b = libc_test .b ;
2560+ const test_mod = b .createModule (.{
2561+ .target = libc_test .target ,
2562+ .optimize = libc_test .optimize ,
2563+ .link_libc = true ,
2564+ });
2565+
2566+ test_mod .addIncludePath (libc_test .src .path (b , "common" ));
2567+
2568+ test_mod .addCSourceFile (.{
2569+ .file = libc_test .src .path (b , "functional/tls_align.c" ),
2570+ });
2571+
2572+ test_mod .linkLibrary (libc_test .libtest );
2573+
2574+ // Link against 'tls_align_dso.so'
2575+ test_mod .linkLibrary (installTestLibrary (libc_test , "functional/tls_align_dso.c" ));
2576+
2577+ const exe = b .addExecutable (.{
2578+ .name = "tls_align" ,
2579+ .root_module = test_mod ,
2580+ });
2581+
2582+ installTestCase (libc_test , exe , .{});
2583+ }
2584+
25492585fn installTlsAlignStaticTestCase (libc_test : * const LibCTest , support : LibCImpl.Support , debug_only : bool ) void {
25502586 if (support .shouldSkip (libc_test )) return ;
25512587 if (debug_only and libc_test .optimize != .Debug ) return ;
0 commit comments