math: add more fmaf tests
[libc-test] / src / api / stdio.c
1 #include <stdio.h>
2 #define T(t) (t*)0;
3 #define F(t,n) {t *y = &x.n;}
4 #define C(n) switch(n){case n:;}
5 static void f()
6 {
7 T(FILE)
8 T(fpos_t)
9 T(off_t)
10 T(size_t)
11 C(BUFSIZ)
12 #ifdef _POSIX_C_SOURCE
13 T(ssize_t)
14 T(va_list)
15 C(L_ctermid)
16 #endif
17 #ifdef OBSOLETE
18 C(L_tmpnam)
19 #endif
20 C(_IOFBF)
21 C(_IOLBF)
22 C(_IONBF)
23 C(SEEK_CUR)
24 C(SEEK_END)
25 C(SEEK_SET)
26 C(FILENAME_MAX)
27 C(FOPEN_MAX)
28 C(EOF)
29 {void *x=NULL;}
30 {FILE *x=stderr;}
31 {FILE *x=stdin;}
32 {FILE *x=stdout;}
33 {void(*p)(FILE*) = clearerr;}
34 {char*(*p)(char*) = ctermid;}
35 {int(*p)(int,const char*restrict,...) = dprintf;}
36 {int(*p)(FILE*) = fclose;}
37 {FILE*(*p)(int,const char*) = fdopen;}
38 {int(*p)(FILE*) = feof;}
39 {int(*p)(FILE*) = ferror;}
40 {int(*p)(FILE*) = fflush;}
41 {int(*p)(FILE*) = fgetc;}
42 {int(*p)(FILE*restrict,fpos_t*restrict) = fgetpos;}
43 {char*(*p)(char*restrict,int,FILE*restrict) = fgets;}
44 {int(*p)(FILE*) = fileno;}
45 {void(*p)(FILE*) = flockfile;}
46 {FILE*(*p)(void*restrict,size_t,const char*restrict) = fmemopen;}
47 {FILE*(*p)(const char*restrict,const char*restrict) = fopen;}
48 {int(*p)(FILE*restrict,const char*restrict,...) = fprintf;}
49 {int(*p)(int,FILE*) = fputc;}
50 {int(*p)(const char*restrict,FILE*restrict) = fputs;}
51 {size_t(*p)(void*restrict,size_t,size_t,FILE*restrict) = fread;}
52 {FILE*(*p)(const char*restrict,const char*restrict,FILE*restrict) = freopen;}
53 {int(*p)(FILE*restrict,const char*restrict,...) = fscanf;}
54 {int(*p)(FILE*,long,int) = fseek;}
55 {int(*p)(FILE*,off_t,int) = fseeko;}
56 {int(*p)(FILE*,const fpos_t*) = fsetpos;}
57 {long(*p)(FILE*) = ftell;}
58 {off_t(*p)(FILE*) = ftello;}
59 {int(*p)(FILE*) = ftrylockfile;}
60 {void(*p)(FILE*) = funlockfile;}
61 {size_t(*p)(const void*restrict,size_t,size_t,FILE*restrict) = fwrite;}
62 {int(*p)(FILE*) = getc;}
63 {int(*p)(FILE*) = getc_unlocked;}
64 {int(*p)(void) = getchar;}
65 {int(*p)(void) = getchar_unlocked;}
66 {ssize_t(*p)(char**restrict,size_t*restrict,int,FILE*restrict) = getdelim;}
67 {ssize_t(*p)(char**restrict,size_t*restrict,FILE*restrict) = getline;}
68 {char*(*p)(char*) = gets;}
69 {FILE*(*p)(char**,size_t*) = open_memstream;}
70 {int(*p)(FILE*) = pclose;}
71 {void(*p)(const char*) = perror;}
72 {FILE*(*p)(const char*,const char*) = popen;}
73 {int(*p)(const char*restrict,...) = printf;}
74 {int(*p)(int,FILE*) = putc;}
75 {int(*p)(int,FILE*) = putc_unlocked;}
76 {int(*p)(int) = putchar;}
77 {int(*p)(int) = putchar_unlocked;}
78 {int(*p)(const char*) = puts;}
79 {int(*p)(const char*) = remove;}
80 {int(*p)(const char*,const char*) = rename;}
81 {int(*p)(int,const char*,int,const char*) = renameat;}
82 {void(*p)(FILE*) = rewind;}
83 {int(*p)(const char*restrict,...) = scanf;}
84 {void(*p)(FILE*restrict,char*restrict) = setbuf;}
85 {int(*p)(FILE*restrict,char*restrict,int,size_t) = setvbuf;}
86 {int(*p)(char*restrict,size_t,const char*restrict,...) = snprintf;}
87 {int(*p)(char*restrict,const char*restrict,...) = sprintf;}
88 {int(*p)(const char*restrict,const char*restrict,...) = sscanf;}
89 {char*(*p)(const char*,const char*) = tempnam;}
90 {FILE*(*p)(void) = tmpfile;}
91 {char*(*p)(char*) = tmpnam;}
92 {int(*p)(int,FILE*) = ungetc;}
93 }
94 #include <wchar.h>
95 static void g()
96 {
97 {wint_t(*p)(int) = btowc;}
98 {wint_t(*p)(FILE*) = fgetwc;}
99 {wchar_t*(*p)(wchar_t*restrict,int,FILE*restrict) = fgetws;}
100 {wint_t(*p)(wchar_t,FILE*) = fputwc;}
101 {int(*p)(const wchar_t*restrict,FILE*restrict) = fputws;}
102 {int(*p)(FILE*,int) = fwide;}
103 {int(*p)(FILE*restrict,const wchar_t*restrict,...) = fwprintf;}
104 {int(*p)(FILE*restrict,const wchar_t*restrict,...) = fwscanf;}
105 {wint_t(*p)(FILE*) = getwc;}
106 {wint_t(*p)(wchar_t,FILE*) = putwc;}
107 {int(*p)(wchar_t*restrict,size_t,const wchar_t*restrict,...) = swprintf;}
108 {int(*p)(const wchar_t*restrict,const wchar_t*restrict,...) = swscanf;}
109 {wint_t(*p)(wint_t,FILE*) = ungetwc;}
110 {int(*p)(wint_t) = wctob;}
111 {int(*p)(const wchar_t*restrict,...) = wprintf;}
112 {int(*p)(const wchar_t*restrict,...) = wscanf;}
113 }
114 #include <stdarg.h>
115 static void h()
116 {
117 {int(*p)(int,const char*restrict,va_list) = vdprintf;}
118 {int(*p)(FILE*restrict,const char*restrict,va_list) = vfprintf;}
119 {int(*p)(FILE*restrict,const char*restrict,va_list) = vfscanf;}
120 {int(*p)(const char*restrict,va_list) = vprintf;}
121 {int(*p)(const char*restrict,va_list) = vscanf;}
122 {int(*p)(char*restrict,size_t,const char*restrict,va_list) = vsnprintf;}
123 {int(*p)(char*restrict,const char*restrict,va_list) = vsprintf;}
124 {int(*p)(const char*restrict,const char*restrict,va_list) = vsscanf;}
125
126 {int(*p)(FILE*restrict,const wchar_t*restrict,va_list) = vfwprintf;}
127 {int(*p)(FILE*restrict,const wchar_t*restrict,va_list) = vfwscanf;}
128 {int(*p)(wchar_t*restrict,size_t,const wchar_t*restrict,va_list) = vswprintf;}
129 {int(*p)(const wchar_t*restrict,const wchar_t*restrict,va_list) = vswscanf;}
130 {int(*p)(const wchar_t*restrict,va_list) = vwprintf;}
131 {int(*p)(const wchar_t*restrict,va_list) = vwscanf;}
132 }