]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/tr1/8_c_compatibility/cwchar/functions.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / tr1 / 8_c_compatibility / cwchar / functions.cc
CommitLineData
af66a43e
PC
1// { dg-do compile }
2
3// 2006-02-03 Paolo Carlini <pcarlini@suse.de>
4//
83ffe9cd 5// Copyright (C) 2006-2023 Free Software Foundation, Inc.
af66a43e
PC
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
748086b7 10// Free Software Foundation; either version 3, or (at your option)
af66a43e
PC
11// any later version.
12//
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.
17//
18// You should have received a copy of the GNU General Public License along
748086b7
JJ
19// with this library; see the file COPYING3. If not see
20// <http://www.gnu.org/licenses/>.
af66a43e
PC
21
22// 8.6 Additions to header <cwchar>
23
24#include <tr1/cwchar>
25#include <cstdio>
26#include <cstdarg>
27
28#if _GLIBCXX_USE_WCHAR_T
29
eef5c0ca 30void test01(int dummy, ...)
af66a43e 31{
eef5c0ca
PC
32 std::va_list arg;
33 va_start(arg, dummy);
af66a43e 34
93638ec7
PC
35#if _GLIBCXX_HAVE_WCSTOF
36 const wchar_t* nptr1 = 0;
37 wchar_t** endptr1 = 0;
af66a43e 38 float fret;
93638ec7 39 fret = std::tr1::wcstof(nptr1, endptr1);
567d4027
PC
40
41 fret = fret; // Suppress unused warning.
93638ec7
PC
42#endif
43
44#if _GLIBCXX_HAVE_VFWSCANF
45 FILE* stream = 0;
46 const wchar_t* format1 = 0;
47 int ret1;
48 ret1 = std::tr1::vfwscanf(stream, format1, arg);
567d4027
PC
49
50 ret1 = ret1; // Suppress unused warning.
93638ec7 51#endif
af66a43e 52
93638ec7
PC
53#if _GLIBCXX_HAVE_VSWSCANF
54 const wchar_t* s = 0;
55 const wchar_t* format2 = 0;
56 int ret2;
57 ret2 = std::tr1::vswscanf(s, format2, arg);
567d4027
PC
58
59 ret2 = ret2; // Suppress unused warning.
93638ec7
PC
60#endif
61
62#if _GLIBCXX_HAVE_VWSCANF
63 const wchar_t* format3 = 0;
64 int ret3;
65 ret3 = std::tr1::vwscanf(format3, arg);
567d4027
PC
66
67 ret3 = ret3; // Suppress unused warning.
93638ec7
PC
68#endif
69
23c64853 70#if _GLIBCXX_USE_C99_WCHAR
93638ec7
PC
71
72 const wchar_t* nptr2 = 0;
73 wchar_t** endptr2 = 0;
74 long double ldret;
75 ldret = std::tr1::wcstold(nptr2, endptr2);
af66a43e 76
af66a43e
PC
77 int base = 0;
78 long long llret;
79 unsigned long long ullret;
4f0de5dd
PC
80 llret = std::tr1::wcstoll(nptr2, endptr2, base);
81 ullret = std::tr1::wcstoull(nptr2, endptr2, base);
af66a43e 82
567d4027
PC
83 ldret = ldret; // Suppress unused warnings.
84 llret = llret;
85 ullret = ullret;
86
af66a43e
PC
87#endif
88}
89
90#endif