1*4684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
2*4684ddb6SLionel Sambuc //
3*4684ddb6SLionel Sambuc // The LLVM Compiler Infrastructure
4*4684ddb6SLionel Sambuc //
5*4684ddb6SLionel Sambuc // This file is dual licensed under the MIT and the University of Illinois Open
6*4684ddb6SLionel Sambuc // Source Licenses. See LICENSE.TXT for details.
7*4684ddb6SLionel Sambuc //
8*4684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
9*4684ddb6SLionel Sambuc
10*4684ddb6SLionel Sambuc // test <cstdio>
11*4684ddb6SLionel Sambuc
12*4684ddb6SLionel Sambuc #include <cstdio>
13*4684ddb6SLionel Sambuc #include <type_traits>
14*4684ddb6SLionel Sambuc
15*4684ddb6SLionel Sambuc #ifndef BUFSIZ
16*4684ddb6SLionel Sambuc #error BUFSIZ not defined
17*4684ddb6SLionel Sambuc #endif
18*4684ddb6SLionel Sambuc
19*4684ddb6SLionel Sambuc #ifndef EOF
20*4684ddb6SLionel Sambuc #error EOF not defined
21*4684ddb6SLionel Sambuc #endif
22*4684ddb6SLionel Sambuc
23*4684ddb6SLionel Sambuc #ifndef FILENAME_MAX
24*4684ddb6SLionel Sambuc #error FILENAME_MAX not defined
25*4684ddb6SLionel Sambuc #endif
26*4684ddb6SLionel Sambuc
27*4684ddb6SLionel Sambuc #ifndef FOPEN_MAX
28*4684ddb6SLionel Sambuc #error FOPEN_MAX not defined
29*4684ddb6SLionel Sambuc #endif
30*4684ddb6SLionel Sambuc
31*4684ddb6SLionel Sambuc #ifndef L_tmpnam
32*4684ddb6SLionel Sambuc #error L_tmpnam not defined
33*4684ddb6SLionel Sambuc #endif
34*4684ddb6SLionel Sambuc
35*4684ddb6SLionel Sambuc #ifndef NULL
36*4684ddb6SLionel Sambuc #error NULL not defined
37*4684ddb6SLionel Sambuc #endif
38*4684ddb6SLionel Sambuc
39*4684ddb6SLionel Sambuc #ifndef SEEK_CUR
40*4684ddb6SLionel Sambuc #error SEEK_CUR not defined
41*4684ddb6SLionel Sambuc #endif
42*4684ddb6SLionel Sambuc
43*4684ddb6SLionel Sambuc #ifndef SEEK_END
44*4684ddb6SLionel Sambuc #error SEEK_END not defined
45*4684ddb6SLionel Sambuc #endif
46*4684ddb6SLionel Sambuc
47*4684ddb6SLionel Sambuc #ifndef SEEK_SET
48*4684ddb6SLionel Sambuc #error SEEK_SET not defined
49*4684ddb6SLionel Sambuc #endif
50*4684ddb6SLionel Sambuc
51*4684ddb6SLionel Sambuc #ifndef TMP_MAX
52*4684ddb6SLionel Sambuc #error TMP_MAX not defined
53*4684ddb6SLionel Sambuc #endif
54*4684ddb6SLionel Sambuc
55*4684ddb6SLionel Sambuc #ifndef _IOFBF
56*4684ddb6SLionel Sambuc #error _IOFBF not defined
57*4684ddb6SLionel Sambuc #endif
58*4684ddb6SLionel Sambuc
59*4684ddb6SLionel Sambuc #ifndef _IOLBF
60*4684ddb6SLionel Sambuc #error _IOLBF not defined
61*4684ddb6SLionel Sambuc #endif
62*4684ddb6SLionel Sambuc
63*4684ddb6SLionel Sambuc #ifndef _IONBF
64*4684ddb6SLionel Sambuc #error _IONBF not defined
65*4684ddb6SLionel Sambuc #endif
66*4684ddb6SLionel Sambuc
67*4684ddb6SLionel Sambuc #ifndef stderr
68*4684ddb6SLionel Sambuc #error stderr not defined
69*4684ddb6SLionel Sambuc #endif
70*4684ddb6SLionel Sambuc
71*4684ddb6SLionel Sambuc #ifndef stdin
72*4684ddb6SLionel Sambuc #error stdin not defined
73*4684ddb6SLionel Sambuc #endif
74*4684ddb6SLionel Sambuc
75*4684ddb6SLionel Sambuc #ifndef stdout
76*4684ddb6SLionel Sambuc #error stdout not defined
77*4684ddb6SLionel Sambuc #endif
78*4684ddb6SLionel Sambuc
79*4684ddb6SLionel Sambuc #include <cstdarg>
80*4684ddb6SLionel Sambuc
81*4684ddb6SLionel Sambuc #pragma clang diagnostic push
82*4684ddb6SLionel Sambuc #pragma clang diagnostic ignored "-Wformat-zero-length"
83*4684ddb6SLionel Sambuc
main()84*4684ddb6SLionel Sambuc int main()
85*4684ddb6SLionel Sambuc {
86*4684ddb6SLionel Sambuc std::FILE* fp = 0;
87*4684ddb6SLionel Sambuc std::fpos_t fpos = {0};
88*4684ddb6SLionel Sambuc std::size_t s = 0;
89*4684ddb6SLionel Sambuc char* cp = 0;
90*4684ddb6SLionel Sambuc std::va_list va;
91*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::remove("")), int>::value), "");
92*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::rename("","")), int>::value), "");
93*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::tmpfile()), std::FILE*>::value), "");
94*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::tmpnam(cp)), char*>::value), "");
95*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fclose(fp)), int>::value), "");
96*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fflush(fp)), int>::value), "");
97*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fopen("", "")), std::FILE*>::value), "");
98*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::freopen("", "", fp)), std::FILE*>::value), "");
99*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::setbuf(fp,cp)), void>::value), "");
100*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::vfprintf(fp,"",va)), int>::value), "");
101*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fprintf(fp," ")), int>::value), "");
102*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fscanf(fp,"")), int>::value), "");
103*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::printf(" ")), int>::value), "");
104*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::scanf(" ")), int>::value), "");
105*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::snprintf(cp,0," ")), int>::value), "");
106*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::sprintf(cp," ")), int>::value), "");
107*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::sscanf("","")), int>::value), "");
108*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::vfprintf(fp,"",va)), int>::value), "");
109*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::vfscanf(fp,"",va)), int>::value), "");
110*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::vprintf(" ",va)), int>::value), "");
111*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::vscanf("",va)), int>::value), "");
112*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::vsnprintf(cp,0," ",va)), int>::value), "");
113*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::vsprintf(cp," ",va)), int>::value), "");
114*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::vsscanf("","",va)), int>::value), "");
115*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fgetc(fp)), int>::value), "");
116*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fgets(cp,0,fp)), char*>::value), "");
117*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fputc(0,fp)), int>::value), "");
118*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fputs("",fp)), int>::value), "");
119*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::getc(fp)), int>::value), "");
120*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::getchar()), int>::value), "");
121*4684ddb6SLionel Sambuc #if _LIBCPP_STD_VER <= 11
122*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::gets(cp)), char*>::value), "");
123*4684ddb6SLionel Sambuc #endif
124*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::putc(0,fp)), int>::value), "");
125*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::putchar(0)), int>::value), "");
126*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::puts("")), int>::value), "");
127*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::ungetc(0,fp)), int>::value), "");
128*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fread((void*)0,0,0,fp)), std::size_t>::value), "");
129*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fwrite((const void*)0,0,0,fp)), std::size_t>::value), "");
130*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fgetpos(fp, &fpos)), int>::value), "");
131*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fseek(fp, 0,0)), int>::value), "");
132*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fsetpos(fp, &fpos)), int>::value), "");
133*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::ftell(fp)), long>::value), "");
134*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::rewind(fp)), void>::value), "");
135*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::clearerr(fp)), void>::value), "");
136*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::feof(fp)), int>::value), "");
137*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::ferror(fp)), int>::value), "");
138*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::perror("")), void>::value), "");
139*4684ddb6SLionel Sambuc }
140