Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
Howard Hinnant | 0ce0224 | 2010-09-28 17:19:10 +0000 | [diff] [blame] | 2 | //===----------------------------------------------------------------------===// |
Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 3 | // |
| 4 | // The LLVM Compiler Infrastructure |
| 5 | // |
Howard Hinnant | b64f8b0 | 2010-11-16 22:09:02 +0000 | [diff] [blame] | 6 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 7 | // Source Licenses. See LICENSE.TXT for details. |
Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
| 11 | // <regex> |
| 12 | |
| 13 | // namespace regex_constants |
| 14 | // { |
Howard Hinnant | bbd8086 | 2010-08-22 00:45:01 +0000 | [diff] [blame] | 15 | // |
Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 16 | // emum syntax_option_type // bitmask type |
| 17 | // { |
| 18 | // icase = unspecified, |
| 19 | // nosubs = unspecified, |
| 20 | // optimize = unspecified, |
| 21 | // collate = unspecified, |
| 22 | // ECMAScript = unspecified, |
| 23 | // basic = unspecified, |
| 24 | // extended = unspecified, |
| 25 | // awk = unspecified, |
| 26 | // grep = unspecified, |
| 27 | // egrep = unspecified |
| 28 | // }; |
Howard Hinnant | bbd8086 | 2010-08-22 00:45:01 +0000 | [diff] [blame] | 29 | // |
Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 30 | // } |
| 31 | |
| 32 | #include <regex> |
| 33 | #include <cassert> |
| 34 | |
| 35 | int main() |
| 36 | { |
| 37 | assert(std::regex_constants::icase != 0); |
| 38 | assert(std::regex_constants::nosubs != 0); |
| 39 | assert(std::regex_constants::optimize != 0); |
| 40 | assert(std::regex_constants::collate != 0); |
Howard Hinnant | ad2a7ab | 2010-07-27 17:24:17 +0000 | [diff] [blame] | 41 | assert(std::regex_constants::ECMAScript == 0); |
Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 42 | assert(std::regex_constants::basic != 0); |
| 43 | assert(std::regex_constants::extended != 0); |
| 44 | assert(std::regex_constants::awk != 0); |
| 45 | assert(std::regex_constants::grep != 0); |
| 46 | assert(std::regex_constants::egrep != 0); |
| 47 | |
| 48 | assert((std::regex_constants::icase & std::regex_constants::nosubs) == 0); |
| 49 | assert((std::regex_constants::icase & std::regex_constants::optimize) == 0); |
| 50 | assert((std::regex_constants::icase & std::regex_constants::collate) == 0); |
| 51 | assert((std::regex_constants::icase & std::regex_constants::ECMAScript) == 0); |
| 52 | assert((std::regex_constants::icase & std::regex_constants::basic) == 0); |
| 53 | assert((std::regex_constants::icase & std::regex_constants::extended) == 0); |
| 54 | assert((std::regex_constants::icase & std::regex_constants::awk) == 0); |
| 55 | assert((std::regex_constants::icase & std::regex_constants::grep) == 0); |
| 56 | assert((std::regex_constants::icase & std::regex_constants::egrep) == 0); |
| 57 | |
| 58 | assert((std::regex_constants::nosubs & std::regex_constants::optimize) == 0); |
| 59 | assert((std::regex_constants::nosubs & std::regex_constants::collate) == 0); |
| 60 | assert((std::regex_constants::nosubs & std::regex_constants::ECMAScript) == 0); |
| 61 | assert((std::regex_constants::nosubs & std::regex_constants::basic) == 0); |
| 62 | assert((std::regex_constants::nosubs & std::regex_constants::extended) == 0); |
| 63 | assert((std::regex_constants::nosubs & std::regex_constants::awk) == 0); |
| 64 | assert((std::regex_constants::nosubs & std::regex_constants::grep) == 0); |
| 65 | assert((std::regex_constants::nosubs & std::regex_constants::egrep) == 0); |
| 66 | |
| 67 | assert((std::regex_constants::optimize & std::regex_constants::collate) == 0); |
| 68 | assert((std::regex_constants::optimize & std::regex_constants::ECMAScript) == 0); |
| 69 | assert((std::regex_constants::optimize & std::regex_constants::basic) == 0); |
| 70 | assert((std::regex_constants::optimize & std::regex_constants::extended) == 0); |
| 71 | assert((std::regex_constants::optimize & std::regex_constants::awk) == 0); |
| 72 | assert((std::regex_constants::optimize & std::regex_constants::grep) == 0); |
| 73 | assert((std::regex_constants::optimize & std::regex_constants::egrep) == 0); |
| 74 | |
| 75 | assert((std::regex_constants::collate & std::regex_constants::ECMAScript) == 0); |
| 76 | assert((std::regex_constants::collate & std::regex_constants::basic) == 0); |
| 77 | assert((std::regex_constants::collate & std::regex_constants::extended) == 0); |
| 78 | assert((std::regex_constants::collate & std::regex_constants::awk) == 0); |
| 79 | assert((std::regex_constants::collate & std::regex_constants::grep) == 0); |
| 80 | assert((std::regex_constants::collate & std::regex_constants::egrep) == 0); |
| 81 | |
| 82 | assert((std::regex_constants::ECMAScript & std::regex_constants::basic) == 0); |
| 83 | assert((std::regex_constants::ECMAScript & std::regex_constants::extended) == 0); |
| 84 | assert((std::regex_constants::ECMAScript & std::regex_constants::awk) == 0); |
| 85 | assert((std::regex_constants::ECMAScript & std::regex_constants::grep) == 0); |
| 86 | assert((std::regex_constants::ECMAScript & std::regex_constants::egrep) == 0); |
| 87 | |
| 88 | assert((std::regex_constants::basic & std::regex_constants::extended) == 0); |
| 89 | assert((std::regex_constants::basic & std::regex_constants::awk) == 0); |
| 90 | assert((std::regex_constants::basic & std::regex_constants::grep) == 0); |
| 91 | assert((std::regex_constants::basic & std::regex_constants::egrep) == 0); |
| 92 | |
| 93 | assert((std::regex_constants::extended & std::regex_constants::awk) == 0); |
| 94 | assert((std::regex_constants::extended & std::regex_constants::grep) == 0); |
| 95 | assert((std::regex_constants::extended & std::regex_constants::egrep) == 0); |
| 96 | |
| 97 | assert((std::regex_constants::awk & std::regex_constants::grep) == 0); |
| 98 | assert((std::regex_constants::awk & std::regex_constants::egrep) == 0); |
| 99 | |
| 100 | assert((std::regex_constants::grep & std::regex_constants::egrep) == 0); |
| 101 | |
| 102 | assert((std::regex_constants::icase | std::regex_constants::nosubs) != 0); |
| 103 | assert((std::regex_constants::icase ^ std::regex_constants::nosubs) != 0); |
| 104 | |
| 105 | std::regex_constants::syntax_option_type e1 = std::regex_constants::icase; |
| 106 | std::regex_constants::syntax_option_type e2 = std::regex_constants::nosubs; |
| 107 | e1 = ~e1; |
| 108 | e1 = e1 & e2; |
| 109 | e1 = e1 | e2; |
| 110 | e1 = e1 ^ e2; |
| 111 | e1 &= e2; |
| 112 | e1 |= e2; |
| 113 | e1 ^= e2; |
| 114 | } |