From 61b9a7258a7693d7f3674a5a1daf7b036ff1d382 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 6 Sep 2015 18:46:46 +0000 Subject: Import libc++ 3.7.0 release (r246257). --- .../re/re.regex/re.regex.construct/ptr.pass.cpp | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/std/re/re.regex/re.regex.construct/ptr.pass.cpp (limited to 'test/std/re/re.regex/re.regex.construct/ptr.pass.cpp') diff --git a/test/std/re/re.regex/re.regex.construct/ptr.pass.cpp b/test/std/re/re.regex/re.regex.construct/ptr.pass.cpp new file mode 100644 index 0000000000000..b99b58b469cf4 --- /dev/null +++ b/test/std/re/re.regex/re.regex.construct/ptr.pass.cpp @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template > class basic_regex; + +// basic_regex(const charT* p); + +#include +#include + +template +void +test(const CharT* p, unsigned mc) +{ + std::basic_regex r(p); + assert(r.flags() == std::regex_constants::ECMAScript); + assert(r.mark_count() == mc); +} + +int main() +{ + test("\\(a\\)", 0); + test("\\(a[bc]\\)", 0); + test("\\(a\\([bc]\\)\\)", 0); + test("(a([bc]))", 2); +} -- cgit v1.2.3