xref: /netbsd-src/tests/usr.bin/xlint/lint2/emit.ln (revision 656ffdf2e3864b68d292b6310a83df69189a876a)
1# $NetBSD: emit.ln,v 1.7 2024/11/05 04:53:28 rillig Exp $
2#
3# Test emitting a lint library file.
4
5# Extracted from ../lint1/emit.exp-ln.
60 s emit.c
7S emit.c
8
9# Global variables that are declared using 'extern' are not part of a
10# library's interface, therefore they are omitted from the output.
11101 d 0.101 e 12extern__Bool B
12
13# Global variables that are defined, not only declared, are part of a
14# library's interface.
15106 d 0.106 t 11defined_int I
16
17# Referring to an anonymous tagged type forces the source file to be listed as
18# part of the library.  If it weren't listed, the diagnostics from lint2 would
19# not be able to refer to the location where this type has been defined.
2097 d 0.97 e 21extern_anonymous_enum eT395.0.0
21
22# Function declarations, as opposed to function definitions, are not part of a
23# library's interface, therefore they are omitted from the output.
24121 d 0.121 e 30return_void_unknown_parameters F V
25122 d 0.122 e 38return_implicit_int_unknown_parameters F I
26125 d 0.125 e 32extern_return_void_no_parameters F0 V
27
28# Function calls are written as 'c'.  They are not part of a library's
29# interface, therefore they are omitted from the output.
30161 c 0.161 s2"%" i 9my_printf f2 PcC PC V
31
32# Function definitions are copied to the output.
33159 d 0.159 d 14cover_outqchar F0 V
34
35# Taken from ../lint1/expr_promote.exp-ln.
360 s expr_promote.c
37S expr_promote.c
38
3910 d 0.10 e 4sink F2 PcC E V
4058 c 0.58 i 4sink f20 PcC B I I I I I I uI L uL Q uQ D D lD sX X lX eT331.0.0 V
4137 d 0.37 d 6caller F1 PsT116arithmetic_types V
42
43# Emit all basic types.
440 d 0.0 d 9var__Bool B
450 d 0.0 d 14var_plain_char C
460 d 0.0 d 15var_signed_char sC
470 d 0.0 d 17var_unsigned_char uC
480 d 0.0 d 16var_signed_short S
490 d 0.0 d 18var_unsigned_short uS
500 d 0.0 d 14var_signed_int I
510 d 0.0 d 16var_unsigned_int uI
520 d 0.0 d 15var_signed_long L
530 d 0.0 d 17var_unsigned_long uL
540 d 0.0 d 20var_signed_long_long Q
550 d 0.0 d 22var_unsigned_long_long uQ
56# see emit_lp64.c for __int128_t
57# see emit_lp64.c for __uint128_t
580 d 0.0 d 9var_float sD
590 d 0.0 d 10var_double D
600 d 0.0 d 15var_long_double lD
610 d 0.0 d 19var_pointer_to_void PV
620 d 0.0 d 14var_struct_tag sT1 10struct_tag
630 d 0.0 d 18var_struct_typedef sT2 14struct_typedef
640 d 0.0 d 20var_struct_anonymous sT3 0.0.0
650 d 0.0 d 13var_union_tag uT1 9union_tag
660 d 0.0 d 17var_union_typedef uT2 13union_typedef
670 d 0.0 d 19var_union_anonymous uT3 0.0.0
680 d 0.0 d 12var_enum_tag eT1 8enum_tag
690 d 0.0 d 16var_enum_typedef eT2 12enum_typedef
700 d 0.0 d 18var_enum_anonymous eT3 0.0.0
710 d 0.0 d 18var_pointer_to_int PI
720 d 0.0 d 19var_array_of_double A7D
730 d 0.0 d 33var_pointer_to_old_style_function P F I
740 d 0.0 d 37var_pointer_to_parameterless_function P F0 I
750 d 0.0 d 33var_pointer_to_prototype_function P F2 PcvC I I
760 d 0.0 d 31var_pointer_to_varargs_function P F3 PcC I E I
770 d 0.0 d 17var_float_complex sX
780 d 0.0 d 18var_double_complex X
790 d 0.0 d 23var_long_double_complex lX
80
810 d 0.0 d 28func_old_style_parameterless f0 D
820 d 0.0 d 25func_old_style_parameters f2 PC I D
830 d 0.0 v1 d 12func_varargs F2 PC E I
840 d 0.0 v1 P1 d 15func_printflike f1 PC I
850 d 0.0 v1 S1 d 14func_scanflike f1 PC I
86
87# old_style_void() {}
880 d 0.0 d o 14old_style_void f0 I
89# old_style_int() { return 1; }
900 d 0.0 d r o 13old_style_int f0 I
91
92# TODO: find out how traditional C defined a varargs function
93