OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [libstdc++-v3/] [testsuite/] [20_util/] [common_type/] [requirements/] [typedefs-2.cc] - Blame information for rev 424

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 424 jeremybenn
// { dg-options "-std=gnu++0x" }
2
// 2009-11-12  Paolo Carlini  <paolo.carlini@oracle.com>
3
//
4
// Copyright (C) 2009 Free Software Foundation, Inc.
5
//
6
// This file is part of the GNU ISO C++ Library.  This library is free
7
// software; you can redistribute it and/or modify it under the
8
// terms of the GNU General Public License as published by the
9
// Free Software Foundation; either version 3, or (at your option)
10
// any later version.
11
//
12
// This library is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
// GNU General Public License for more details.
16
//
17
// You should have received a copy of the GNU General Public License along
18
// with this library; see the file COPYING3.  If not see
19
// <http://www.gnu.org/licenses/>.
20
 
21
#include <type_traits>
22
#include <testsuite_hooks.h>
23
 
24
// DR 1255.
25
void test01()
26
{
27
  bool test __attribute__((unused)) = true;
28
  using std::common_type;
29
  using std::is_same;
30
 
31
  VERIFY( (is_same<common_type<void>::type, void>::value) );
32
  VERIFY( (is_same<common_type<const void>::type, const void>::value) );
33
  VERIFY( (is_same<common_type<volatile void>::type, volatile void>::value) );
34
  VERIFY( (is_same<common_type<const volatile void>::type,
35
                   const volatile void>::value) );
36
 
37
  VERIFY( (is_same<common_type<void, void>::type, void>::value) );
38
  VERIFY( (is_same<common_type<void, const void>::type, void>::value) );
39
  VERIFY( (is_same<common_type<void, volatile void>::type, void>::value) );
40
  VERIFY( (is_same<common_type<void, const volatile void>::type,
41
                   void>::value) );
42
  VERIFY( (is_same<common_type<const void, void>::type,
43
                   void>::value) );
44
  VERIFY( (is_same<common_type<const void, const void>::type,
45
                   void>::value) );
46
  VERIFY( (is_same<common_type<const void, volatile void>::type,
47
                   void>::value) );
48
  VERIFY( (is_same<common_type<const void, const volatile void>::type,
49
                   void>::value) );
50
  VERIFY( (is_same<common_type<volatile void, void>::type,
51
                   void>::value) );
52
  VERIFY( (is_same<common_type<volatile void, volatile void>::type,
53
                   void>::value) );
54
  VERIFY( (is_same<common_type<volatile void, const void>::type,
55
                   void>::value) );
56
  VERIFY( (is_same<common_type<volatile void, const volatile void>::type,
57
                   void>::value) );
58
  VERIFY( (is_same<common_type<const volatile void, void>::type,
59
                   void>::value) );
60
  VERIFY( (is_same<common_type<const volatile void, const void>::type,
61
                   void>::value) );
62
  VERIFY( (is_same<common_type<const volatile void, volatile void>::type,
63
                   void>::value) );
64
  VERIFY( (is_same<common_type<const volatile void, const volatile void>::type,
65
                   void>::value) );
66
 }
67
 
68
int main()
69
{
70
  test01();
71
  return 0;
72
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.