Skip to content

Commit 6be9648

Browse files
authored
Improve test_standalone_system_headers. NFC (#22854)
Include `compat` headers. See #22850
1 parent f5b6c66 commit 6be9648

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

system/include/compat/xlocale.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#ifndef _COMPAT_XLOCALE_H_
22
#define _COMPAT_XLOCALE_H_
33

4+
#define __NEED_locale_t
5+
#include <bits/alltypes.h>
6+
47
#include <locale.h>
58

69
#ifdef __cplusplus

test/test_other.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9349,7 +9349,7 @@ def test_standalone_system_headers(self):
93499349
# everything it needs.
93509350
directories = {'': []}
93519351
for elem in os.listdir(path_from_root('system/include')):
9352-
if elem in ('compat', 'fakesdl'):
9352+
if elem == 'fakesdl':
93539353
continue
93549354
full = path_from_root('system/include', elem)
93559355
if os.path.isdir(full):
@@ -9373,19 +9373,22 @@ def test_standalone_system_headers(self):
93739373
cxx_only = header in [
93749374
'wire.h', 'val.h', 'bind.h',
93759375
'webgpu_cpp.h', 'webgpu_cpp_chained_struct.h', 'webgpu_enum_class_bitmasks.h',
9376+
# Some headers are not yet C compatible
9377+
'arm_neon.h', 'avxintrin.h', 'immintrin.h',
93769378
]
9377-
if directory:
9379+
if directory and directory != 'compat':
93789380
header = f'{directory}/{header}'
93799381
inc = f'#include <{header}>\n__attribute__((weak)) int foo;\n'
9382+
cflags = ['-Werror', '-Wall', '-pedantic', '-mavx', '-msimd128', '-msse3']
93809383
if cxx_only:
93819384
create_file('a.cxx', inc)
93829385
create_file('b.cxx', inc)
9383-
self.run_process([EMXX, '-Werror', '-Wall', '-pedantic', 'a.cxx', 'b.cxx'])
9386+
self.run_process([EMXX, '-msse3', 'a.cxx', 'b.cxx'] + cflags)
93849387
else:
93859388
create_file('a.c', inc)
93869389
create_file('b.c', inc)
93879390
for std in ([], ['-std=c89']):
9388-
self.run_process([EMCC] + std + ['-Werror', '-Wall', '-pedantic', 'a.c', 'b.c'])
9391+
self.run_process([EMCC, 'a.c', 'b.c'] + std + cflags)
93899392

93909393
@is_slow_test
93919394
@parameterized({

0 commit comments

Comments
 (0)