OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libstdc++-v3/] [testsuite/] [28_regex/] [constants/] [syntax_option_type.cc] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 742 jeremybenn
// { dg-options "-std=c++0x" }
2
// { dg-do compile }
3
//
4
// 2009-06-17  Stephen M. Webb  <stephen.webb@xandros.com>
5
//
6
// Copyright (C) 2009 Free Software Foundation, Inc.
7
//
8
// This file is part of the GNU ISO C++ Library.  This library is free
9
// software; you can redistribute it and/or modify it under the
10
// terms of the GNU General Public License as published by the
11
// Free Software Foundation; either version 3, or (at your option)
12
// any later version.
13
//
14
// This library is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
// GNU General Public License for more details.
18
//
19
// You should have received a copy of the GNU General Public License along
20
// with this library; see the file COPYING3.  If not see
21
// <http://www.gnu.org/licenses/>.
22
 
23
// 28.5.1 
24
 
25
#include <regex>
26
 
27
void
28
test01()
29
{
30
  std::regex_constants::syntax_option_type option { };
31
  option = option | std::regex_constants::icase;
32
  option = option | std::regex_constants::nosubs;
33
  option = option | std::regex_constants::optimize;
34
  option = option | std::regex_constants::collate;
35
  option = option | std::regex_constants::ECMAScript;
36
  option = option | std::regex_constants::basic;
37
  option = option | std::regex_constants::extended;
38
  option = option | std::regex_constants::awk;
39
  option = option | std::regex_constants::grep;
40
  option = option | std::regex_constants::egrep;
41
}
42
 
43
void
44
test02()
45
{
46
  std::regex_constants::syntax_option_type option { };
47
  option = option & std::regex_constants::icase;
48
  option = option & std::regex_constants::nosubs;
49
  option = option & std::regex_constants::optimize;
50
  option = option & std::regex_constants::collate;
51
  option = option & std::regex_constants::ECMAScript;
52
  option = option & std::regex_constants::basic;
53
  option = option & std::regex_constants::extended;
54
  option = option & std::regex_constants::awk;
55
  option = option & std::regex_constants::grep;
56
  option = option & std::regex_constants::egrep;
57
}
58
 
59
void
60
test03()
61
{
62
  std::regex_constants::syntax_option_type option { };
63
  option = ~std::regex_constants::icase;
64
  option = ~std::regex_constants::nosubs;
65
  option = ~std::regex_constants::optimize;
66
  option = ~std::regex_constants::collate;
67
  option = ~std::regex_constants::ECMAScript;
68
  option = ~std::regex_constants::basic;
69
  option = ~std::regex_constants::extended;
70
  option = ~std::regex_constants::awk;
71
  option = ~std::regex_constants::grep;
72
  option = ~std::regex_constants::egrep;
73
  option = option;
74
}
75
 
76
void
77
test04_constexpr()
78
{
79
  using namespace std::regex_constants;
80
  constexpr auto a1 __attribute__((unused)) = icase | awk;
81
  constexpr auto a2 __attribute__((unused)) = icase & awk;
82
  constexpr auto a3 __attribute__((unused)) = ~grep;
83
}
84
 
85
int main()
86
{
87
  test01();
88
  test02();
89
  test03();
90
  return 0;
91
}

powered by: WebSVN 2.1.0

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