Skip to content

Commit aaa70af

Browse files
committed
updated tests with grouped guarded functions
1 parent df82932 commit aaa70af

File tree

3 files changed

+41
-10
lines changed

3 files changed

+41
-10
lines changed

libc/newhdrgen/tests/expected_output/test_header.h

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
#define LLVM_LIBC_TEST_SMALL_H
1111

1212
#include "__llvm-libc-common.h"
13+
#include "llvm-libc-macros/float16-macros.h"
1314
#include "llvm-libc-macros/test_small-macros.h"
15+
#include "llvm-libc-types/float128.h"
1416

1517
#define MACRO_A 1
1618

@@ -26,13 +28,21 @@ enum {
2628

2729
__BEGIN_C_DECLS
2830

29-
#ifdef FUNC_A_16
3031
CONST_FUNC_A void func_a() __NOEXCEPT;
31-
#endif // FUNC_A_16
3232

33-
#ifdef FUNC_B_16
34-
CONST_FUNC_B int func_b(int, float) __NOEXCEPT;
35-
#endif // FUNC_B_16
33+
#ifdef LIBC_TYPES_HAS_FLOAT128
34+
float128 func_b() __NOEXCEPT;
35+
#endif // LIBC_TYPES_HAS_FLOAT128
36+
37+
#ifdef LIBC_TYPES_HAS_FLOAT16
38+
_Float16 func_c(int, float) __NOEXCEPT;
39+
40+
_Float16 func_d(int, float) __NOEXCEPT;
41+
#endif // LIBC_TYPES_HAS_FLOAT16
42+
43+
#ifdef LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
44+
_Float16 func_e(float128) __NOEXCEPT;
45+
#endif // LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
3646

3747
extern obj object_1;
3848
extern obj object_2;

libc/newhdrgen/tests/input/test_small.h.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
#define LLVM_LIBC_TEST_SMALL_H
1111

1212
#include "__llvm-libc-common.h"
13+
#include "llvm-libc-macros/float16-macros.h"
1314
#include "llvm-libc-macros/test_small-macros.h"
15+
#include "llvm-libc-types/float128.h"
1416

1517
%%public_api()
1618

libc/newhdrgen/tests/input/test_small.yaml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,35 @@ functions:
2323
arguments: []
2424
standards:
2525
- stdc
26-
guard: FUNC_A_16
2726
attributes:
2827
- CONST_FUNC_A
2928
- name: func_b
30-
return_type: int
29+
return_type: float128
30+
arguments: []
31+
standards:
32+
- stdc
33+
guard: LIBC_TYPES_HAS_FLOAT128
34+
- name: func_c
35+
return_type: _Float16
3136
arguments:
3237
- type: int
3338
- type: float
3439
standards:
3540
- stdc
36-
guard: FUNC_B_16
37-
attributes:
38-
- CONST_FUNC_B
41+
guard: LIBC_TYPES_HAS_FLOAT16
42+
- name: func_d
43+
return_type: _Float16
44+
arguments:
45+
- type: int
46+
- type: float
47+
standards:
48+
- stdc
49+
guard: LIBC_TYPES_HAS_FLOAT16
50+
- name: func_e
51+
return_type: _Float16
52+
arguments:
53+
- type: float128
54+
standards:
55+
- stdc
56+
guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
57+

0 commit comments

Comments
 (0)