[libc-commits] [libc] testing (PR #102649)

via libc-commits libc-commits at lists.llvm.org
Fri Aug 9 10:33:45 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: None (aaryanshukla)

<details>
<summary>Changes</summary>



---

Patch is 138.44 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/102649.diff


19 Files Affected:

- (added) libc/newhdrgen/sort_functions_names.py (+38) 
- (modified) libc/newhdrgen/yaml/ctype.yaml (+12-12) 
- (modified) libc/newhdrgen/yaml/fcntl.yaml (+3-3) 
- (modified) libc/newhdrgen/yaml/fenv.yaml (+30-30) 
- (modified) libc/newhdrgen/yaml/math.yaml (+1235-1235) 
- (modified) libc/newhdrgen/yaml/pthread.yaml (+89-89) 
- (modified) libc/newhdrgen/yaml/sched.yaml (+7-7) 
- (modified) libc/newhdrgen/yaml/search.yaml (+10-10) 
- (modified) libc/newhdrgen/yaml/signal.yaml (+20-20) 
- (modified) libc/newhdrgen/yaml/stdbit.yaml (+115-115) 
- (modified) libc/newhdrgen/yaml/stdfix.yaml (+34-34) 
- (modified) libc/newhdrgen/yaml/stdio.yaml (+146-146) 
- (modified) libc/newhdrgen/yaml/stdlib.yaml (+77-77) 
- (modified) libc/newhdrgen/yaml/string.yaml (+126-126) 
- (modified) libc/newhdrgen/yaml/strings.yaml (+20-20) 
- (modified) libc/newhdrgen/yaml/termios.yaml (+10-10) 
- (modified) libc/newhdrgen/yaml/threads.yaml (+16-16) 
- (modified) libc/newhdrgen/yaml/time.yaml (+6-6) 
- (modified) libc/newhdrgen/yaml/unistd.yaml (+53-53) 


``````````diff
diff --git a/libc/newhdrgen/sort_functions_names.py b/libc/newhdrgen/sort_functions_names.py
new file mode 100644
index 0000000000000..e6042624196e8
--- /dev/null
+++ b/libc/newhdrgen/sort_functions_names.py
@@ -0,0 +1,38 @@
+# ex: must be within yaml directory
+import yaml
+import os
+
+
+def sort_yaml_functions(yaml_file):
+    with open(yaml_file, "r") as f:
+        yaml_data = yaml.load(f, Loader=yaml.FullLoader)
+
+    if "functions" in yaml_data:
+        yaml_data["functions"].sort(key=lambda x: x["name"])
+
+    class IndentYamlListDumper(yaml.Dumper):
+        def increase_indent(self, flow=False, indentless=False):
+            return super(IndentYamlListDumper, self).increase_indent(flow, False)
+
+    with open(yaml_file, "w") as f:
+        yaml.dump(
+            yaml_data,
+            f,
+            Dumper=IndentYamlListDumper,
+            default_flow_style=False,
+            sort_keys=False,
+        )
+
+
+def main():
+    current_directory = os.getcwd()
+    yaml_files = [
+        file for file in os.listdir(current_directory) if file.endswith(".yaml")
+    ]
+
+    for yaml_file in yaml_files:
+        sort_yaml_functions(yaml_file)
+
+
+if __name__ == "__main__":
+    main()
\ No newline at end of file
diff --git a/libc/newhdrgen/yaml/ctype.yaml b/libc/newhdrgen/yaml/ctype.yaml
index e5b4d11422d98..f3108a34d4337 100644
--- a/libc/newhdrgen/yaml/ctype.yaml
+++ b/libc/newhdrgen/yaml/ctype.yaml
@@ -16,6 +16,12 @@ functions:
     return_type: int
     arguments:
       - type: int
+  - name: isascii
+    standards:
+      - POSIX
+    return_type: int
+    arguments:
+      - type: int
   - name: isblank
     standards:
       - stdc
@@ -76,28 +82,22 @@ functions:
     return_type: int
     arguments:
       - type: int
-  - name: tolower
+  - name: toascii
     standards:
-      - stdc
+      - GNUExtensions
     return_type: int
     arguments:
       - type: int
-  - name: toupper
+  - name: tolower
     standards:
       - stdc
     return_type: int
     arguments:
       - type: int
-    functions:
-  - name: isascii
-    standards:
-      - POSIX
-    return_type: int
-    arguments:
-      - type: int
-  - name: toascii
+  - name: toupper
     standards:
-      - GNUExtensions
+      - stdc
     return_type: int
     arguments:
       - type: int
+    functions: null
diff --git a/libc/newhdrgen/yaml/fcntl.yaml b/libc/newhdrgen/yaml/fcntl.yaml
index a7bd1997b0eac..71c0df3b0fada 100644
--- a/libc/newhdrgen/yaml/fcntl.yaml
+++ b/libc/newhdrgen/yaml/fcntl.yaml
@@ -20,7 +20,7 @@ functions:
     arguments:
       - type: int
       - type: int
-      - type: ...
+      - type: '...'
   - name: open
     standards:
       - POSIX
@@ -28,7 +28,7 @@ functions:
     arguments:
       - type: const char *
       - type: int
-      - type: ...
+      - type: '...'
   - name: openat
     standards:
       - POSIX
@@ -37,4 +37,4 @@ functions:
       - type: int
       - type: const char *
       - type: int
-      - type: ...
+      - type: '...'
diff --git a/libc/newhdrgen/yaml/fenv.yaml b/libc/newhdrgen/yaml/fenv.yaml
index 95eb93c883e3c..1010efc6402c1 100644
--- a/libc/newhdrgen/yaml/fenv.yaml
+++ b/libc/newhdrgen/yaml/fenv.yaml
@@ -12,55 +12,61 @@ functions:
     return_type: int
     arguments:
       - type: int
-  - name: fetestexcept
+  - name: fedisableexcept
     standards:
-      - stdc
+      - GNUExtensions
     return_type: int
     arguments:
       - type: int
-  - name: fetestexceptflag
+    guard: null
+  - name: feenableexcept
     standards:
-      - stdc
+      - GNUExtensions
     return_type: int
     arguments:
-      - type: const fexcept_t *
       - type: int
-  - name: feraiseexcept
+    attributes: []
+  - name: fegetenv
     standards:
       - stdc
     return_type: int
     arguments:
-      - type: int
-  - name: fesetround
+      - type: fenv_t *
+  - name: fegetexcept
+    standards:
+      - GNUExtensions
+    return_type: int
+    arguments: []
+  - name: fegetexceptflag
     standards:
       - stdc
     return_type: int
     arguments:
+      - type: fexcept_t *
       - type: int
   - name: fegetround
     standards:
       - stdc
     return_type: int
     arguments: []
-  - name: fegetenv
+  - name: feholdexcept
     standards:
       - stdc
     return_type: int
     arguments:
       - type: fenv_t *
-  - name: fesetenv
+  - name: feraiseexcept
     standards:
       - stdc
     return_type: int
     arguments:
-      - type: const fenv_t *
-  - name: fegetexceptflag
+      - type: int
+  - name: fesetenv
     standards:
       - stdc
     return_type: int
     arguments:
-      - type: fexcept_t *
-      - type: int
+      - type: const fenv_t *
   - name: fesetexcept
     standards:
       - stdc
@@ -74,34 +80,28 @@ functions:
     arguments:
       - type: const fexcept_t *
       - type: int
-  - name: feholdexcept
+  - name: fesetround
     standards:
       - stdc
     return_type: int
     arguments:
-      - type: fenv_t *
-  - name: feupdateenv
+      - type: int
+  - name: fetestexcept
     standards:
       - stdc
     return_type: int
-    arguments:
-      - type: const fenv_t *
-  - name: fedisableexcept
-    standards:
-      - GNUExtensions
-    return_type: int
     arguments:
       - type: int
-    guard: null
-  - name: feenableexcept
+  - name: fetestexceptflag
     standards:
-      - GNUExtensions
+      - stdc
     return_type: int
     arguments:
+      - type: const fexcept_t *
       - type: int
-    attributes: []
-  - name: fegetexcept
+  - name: feupdateenv
     standards:
-      - GNUExtensions
+      - stdc
     return_type: int
-    arguments: []
+    arguments:
+      - type: const fenv_t *
diff --git a/libc/newhdrgen/yaml/math.yaml b/libc/newhdrgen/yaml/math.yaml
index 080f6ac0ee888..b724ac9fc17c7 100644
--- a/libc/newhdrgen/yaml/math.yaml
+++ b/libc/newhdrgen/yaml/math.yaml
@@ -7,816 +7,851 @@ types:
 enums: []
 objects: []
 functions:
-  - name: cbrt
+  - name: acosf
     standards:
       - stdc
-    return_type: double
+    return_type: float
     arguments:
-      - type: double
-  - name: cbrtf
+      - type: float
+  - name: acoshf
     standards:
       - stdc
     return_type: float
     arguments:
       - type: float
-  - name: copysign
+  - name: asin
     standards:
       - stdc
     return_type: double
     arguments:
       - type: double
-      - type: double
-  - name: copysignf
+  - name: asinf
     standards:
       - stdc
     return_type: float
     arguments:
       - type: float
-      - type: float
-  - name: copysignl
+  - name: asinhf
     standards:
       - stdc
-    return_type: long double
+    return_type: float
     arguments:
-      - type: long double
-      - type: long double
-  - name: ceil
+      - type: float
+  - name: atan2f
     standards:
       - stdc
-    return_type: double
+    return_type: float
     arguments:
-      - type: double
-  - name: ceilf
+      - type: float
+      - type: float
+  - name: atanf
     standards:
       - stdc
     return_type: float
     arguments:
       - type: float
-  - name: ceill
+  - name: atanhf
     standards:
       - stdc
-    return_type: long double
+    return_type: float
     arguments:
-      - type: long double
-  - name: fabs
+      - type: float
+  - name: canonicalize
     standards:
       - stdc
-    return_type: double
+    return_type: int
     arguments:
       - type: double
-  - name: fabsf
+      - type: double
+  - name: canonicalizef
     standards:
       - stdc
-    return_type: float
+    return_type: int
     arguments:
       - type: float
-  - name: fabsl
+      - type: float
+  - name: canonicalizef128
     standards:
       - stdc
-    return_type: long double
+    return_type: int
     arguments:
-      - type: long double
-  - name: fadd
+      - type: float128
+      - type: float128
+    guard: LIBC_TYPES_HAS_FLOAT128
+  - name: canonicalizef16
     standards:
       - stdc
-    return_type: float
+    return_type: int
     arguments:
-      - type: double 
-      - type: double
-  - name: faddl
+      - type: _Float16
+      - type: _Float16
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: canonicalizel
     standards:
-      - faddl
-    return_type: float
+      - stdc
+    return_type: int
     arguments:
       - type: long double
       - type: long double
-  - name: faddf128
-    standards:
-      - llvm_libc_ext
-    return_type: float
-    arguments:
-      - type: float128
-      - type: float128
-    guard: LIBC_TYPES_HAS_FLOAT128
-  - name: fdim
+  - name: cbrt
     standards:
       - stdc
     return_type: double
     arguments:
       - type: double
-      - type: double
-  - name: fdimf
+  - name: cbrtf
     standards:
       - stdc
     return_type: float
     arguments:
       - type: float
-      - type: float
-  - name: fdiml
-    standards:
-      - stdc
-    return_type: long double
-    arguments:
-      - type: long double
-      - type: long double
-  - name: floor
+  - name: ceil
     standards:
       - stdc
     return_type: double
     arguments:
       - type: double
-  - name: floorf
+  - name: ceilf
     standards:
       - stdc
     return_type: float
     arguments:
       - type: float
-  - name: floorl
-    standards:
-      - stdc
-    return_type: long double
-    arguments:
-      - type: long double
-  - name: fmin
+  - name: ceilf128
     standards:
       - stdc
-    return_type: double
+    return_type: float128
     arguments:
-      - type: double
-      - type: double
-  - name: fminf
+      - type: float128
+    guard: LIBC_TYPES_HAS_FLOAT128
+  - name: ceilf16
     standards:
       - stdc
-    return_type: float
+    return_type: _Float16
     arguments:
-      - type: float
-      - type: float
-  - name: fminl
+      - type: _Float16
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: ceill
     standards:
       - stdc
     return_type: long double
     arguments:
       - type: long double
-      - type: long double
-  - name: fmax
+  - name: copysign
     standards:
       - stdc
     return_type: double
     arguments:
       - type: double
       - type: double
-  - name: fmaxf
+  - name: copysignf
     standards:
       - stdc
     return_type: float
     arguments:
       - type: float
       - type: float
-  - name: fmaxl
-    standards:
-      - stdc
-    return_type: long double
-    arguments:
-      - type: long double
-      - type: long double
-  - name: fmaximum
+  - name: copysignf128
     standards:
       - stdc
-    return_type: double
+    return_type: float128
     arguments:
-      - type: double
-      - type: double
-  - name: fmaximumf
+      - type: float128
+      - type: float128
+    guard: LIBC_TYPES_HAS_FLOAT128
+  - name: copysignf16
     standards:
       - stdc
-    return_type: float
+    return_type: _Float16
     arguments:
-      - type: float
-      - type: float
-  - name: fmaximuml
+      - type: _Float16
+      - type: _Float16
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: copysignl
     standards:
       - stdc
     return_type: long double
     arguments:
       - type: long double
       - type: long double
-  - name: fmaximum_num
+  - name: cos
     standards:
       - stdc
     return_type: double
     arguments:
       - type: double
-      - type: double
-  - name: fmaximum_numf
+  - name: cosf
     standards:
       - stdc
     return_type: float
     arguments:
       - type: float
+  - name: coshf
+    standards:
+      - stdc
+    return_type: float
+    arguments:
       - type: float
-  - name: fmaximum_numl
+  - name: ddivl
     standards:
       - stdc
     return_type: long double
     arguments:
       - type: long double
       - type: long double
-  - name: fmaximum_mag
+  - name: dmulf128
+    standards:
+      - llvm_libc_ext
+    return_type: double
+    arguments:
+      - type: float128
+      - type: float128
+    guard: LIBC_TYPES_HAS_FLOAT128
+  - name: dmull
     standards:
       - stdc
     return_type: double
     arguments:
-      - type: double
-      - type: double
-  - name: fmaximum_magf
+      - type: long double
+      - type: long double
+  - name: erff
     standards:
       - stdc
     return_type: float
     arguments:
       - type: float
-      - type: float
-  - name: fmaximum_magl
+  - name: exp
     standards:
       - stdc
-    return_type: long double
+    return_type: double
     arguments:
-      - type: long double
-      - type: long double
-  - name: fmaximum_mag_num
+      - type: double
+  - name: exp10
     standards:
       - stdc
     return_type: double
     arguments:
       - type: double
-      - type: double
-  - name: fmaximum_mag_numf
+  - name: exp10f
     standards:
       - stdc
     return_type: float
     arguments:
       - type: float
-      - type: float
-  - name: fmaximum_mag_numl
-    standards:
-      - stdc
-    return_type: long double
-    arguments:
-      - type: long double
-      - type: long double
-  - name: fminimum
+  - name: exp2
     standards:
       - stdc
     return_type: double
     arguments:
       - type: double
-      - type: double
-  - name: fminimumf
+  - name: exp2f
     standards:
       - stdc
     return_type: float
     arguments:
       - type: float
+  - name: exp2m1f
+    standards:
+      - stdc
+    return_type: float
+    arguments:
       - type: float
-  - name: fminimuml
+  - name: expf
     standards:
       - stdc
-    return_type: long double
+    return_type: float
     arguments:
-      - type: long double
-      - type: long double
-  - name: fminimum_num
+      - type: float
+  - name: expm1
     standards:
       - stdc
     return_type: double
     arguments:
       - type: double
-      - type: double
-  - name: fminimum_numf
+  - name: expm1f
     standards:
       - stdc
     return_type: float
     arguments:
       - type: float
-      - type: float
-  - name: fminimum_mag
+  - name: f16add
     standards:
-      - stdc
-    return_type: double
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: double
       - type: double
-  - name: fminimum_magf
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16addf
     standards:
-      - stdc
-    return_type: float
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: float
       - type: float
-  - name: fminimum_magl
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16addf128
     standards:
       - stdc
-    return_type: long double
+    return_type: _Float16
+    arguments:
+      - type: float128
+      - type: float128
+    guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
+  - name: f16addl
+    standards:
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: long double
       - type: long double
-  - name: fminimum_mag_num
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16div
     standards:
-      - stdc
-    return_type: double
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: double
       - type: double
-  - name: fminimum_mag_numf
-    standards:
-      - stdc
-    return_type: float
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16divf
+    standards:
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: float
       - type: float
-  - name: fminimum_mag_numl
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16divf128
     standards:
       - stdc
-    return_type: long double
+    return_type: _Float16
+    arguments:
+      - type: float128
+      - type: float128
+    guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
+  - name: f16divl
+    standards:
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: long double
       - type: long double
-  - name: fma
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16fma
     standards:
-      - stdc
-    return_type: double
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: double
       - type: double
       - type: double
-  - name: fmaf
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16fmaf
     standards:
-      - stdc
-    return_type: float
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: float
       - type: float
       - type: float
-  - name: fmod
-    standards:
-      - stdc
-    return_type: double
-    arguments:
-      - type: double
-      - type: double
-  - name: fmodf
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16fmaf128
     standards:
       - stdc
-    return_type: float
+    return_type: _Float16
     arguments:
-      - type: float
-      - type: float
-  - name: fmodl
+      - type: float128
+      - type: float128
+      - type: float128
+    guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
+  - name: f16fmal
     standards:
-      - stdc
-    return_type: long double
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: long double
       - type: long double
-  - name: fmul
+      - type: long double
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16mul
     standards:
-      - stdc
-    return_type: float
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: double
       - type: double
-  - name: fmull
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16mulf
     standards:
-      - stdc
-    return_type: float
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
-      - type: long double
-      - type: long double
-  - name: dmull
+      - type: float
+      - type: float
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16mulf128
     standards:
       - stdc
-    return_type: double
+    return_type: _Float16
+    arguments:
+      - type: float128
+      - type: float128
+    guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
+  - name: f16mull
+    standards:
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: long double
       - type: long double
-  - name: frexp
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16sqrt
     standards:
-      - stdc
-    return_type: double
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: double
-      - type: int *
-  - name: frexpf
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16sqrtf
     standards:
-      - stdc
-    return_type: float
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: float
-      - type: int *
-  - name: frexpl
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16sqrtf128
     standards:
-      - stdc
-    return_type: long double
+      - llvm_libc_ext
+    return_type: _Float16
+    arguments:
+      - type: float128
+    guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
+  - name: f16sqrtl
+    standards:
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: long double
-      - type: int *
-  - name: fromfp
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16sub
     standards:
-      - stdc
-    return_type: double
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: double
-      - type: int
-      - type: unsigned int
-  - name: fromfpf
+      - type: double
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16subf
     standards:
-      - stdc
-    return_type: float
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: float
-      - type: int
-      - type: unsigned int
-  - name: fromfpl
+      - type: float
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: f16subf128
     standards:
       - stdc
-    return_type: long double
+    return_type: _Float16
+    arguments:
+      - type: float128
+      - type: float128
+    guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
+  - name: f16subl
+    standards:
+      - llvm_libc_ext
+    return_type: _Float16
     arguments:
       - type: long double
-      - type: int
-      - type: unsigned int
-  - name: fromfpx
+      - type: long double
+    guard: LIBC_TYPES_HAS_FLOAT16
+  - name: fabs
     standards:
       - stdc
     return_type: double
     arguments:
       - type: double
-      - type: int
-      - type: unsigned int
-  - name: fromfpxf
+  - name: fabsf
     standards:
       - stdc
     return_type: float
     arguments:
       - type: float
-      - type: int
-      - type: unsigned int
-  - name: fromfpxl
-    standards:
-      - stdc
-    return_type: long double
-    arguments:
-      - type: long double
-      - type: int
-      - type: unsigned int
-  - name: ufromfp
+  - name: fabsf128
     standards:
       - stdc
-    return_type: double
+    return_type: float128
     arguments:
-      - type: double
-   ...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/102649


More information about the libc-commits mailing list