Merge from mainline
[official-gcc.git] / libstdc++-v3 / testsuite / tr1 / 8_c_compatibility / cwchar / functions.cc
blob547bce378ccfb064bd237b43a6d385273f3656a9
1 // { dg-do compile }
3 // 2006-02-03 Paolo Carlini <pcarlini@suse.de>
4 //
5 // Copyright (C) 2006 Free Software Foundation, Inc.
6 //
7 // This file is part of the GNU ISO C++ Library. This library is free
8 // software; you can redistribute it and/or modify it under the
9 // terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 2, or (at your option)
11 // any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License along
19 // with this library; see the file COPYING. If not, write to the Free
20 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21 // USA.
23 // 8.6 Additions to header <cwchar>
25 #include <tr1/cwchar>
26 #include <cstdio>
27 #include <cstdarg>
29 #if _GLIBCXX_USE_WCHAR_T
31 void test01(int dummy, ...)
33 std::va_list arg;
34 va_start(arg, dummy);
36 #if _GLIBCXX_HAVE_WCSTOF
37 const wchar_t* nptr1 = 0;
38 wchar_t** endptr1 = 0;
39 float fret;
40 fret = std::tr1::wcstof(nptr1, endptr1);
41 #endif
43 #if _GLIBCXX_HAVE_VFWSCANF
44 FILE* stream = 0;
45 const wchar_t* format1 = 0;
46 int ret1;
47 ret1 = std::tr1::vfwscanf(stream, format1, arg);
48 #endif
50 #if _GLIBCXX_HAVE_VSWSCANF
51 const wchar_t* s = 0;
52 const wchar_t* format2 = 0;
53 int ret2;
54 ret2 = std::tr1::vswscanf(s, format2, arg);
55 #endif
57 #if _GLIBCXX_HAVE_VWSCANF
58 const wchar_t* format3 = 0;
59 int ret3;
60 ret3 = std::tr1::vwscanf(format3, arg);
61 #endif
63 #if _GLIBCXX_USE_C99
65 const wchar_t* nptr2 = 0;
66 wchar_t** endptr2 = 0;
67 long double ldret;
68 ldret = std::tr1::wcstold(nptr2, endptr2);
70 int base = 0;
71 long long llret;
72 unsigned long long ullret;
73 llret = std::tr1::wcstoll(nptr2, endptr2, base);
74 ullret = std::tr1::wcstoull(nptr2, endptr2, base);
76 #endif
79 #endif