1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // XFAIL: with_system_lib=x86_64-apple-darwin11
11 // XFAIL: with_system_lib=x86_64-apple-darwin12
15 // unsigned long long stoull(const string& str, size_t *idx = 0, int base = 10);
16 // unsigned long long stoull(const wstring& str, size_t *idx = 0, int base = 10);
23 assert(std::stoull("0") == 0);
24 assert(std::stoull(L
"0") == 0);
25 assert(std::stoull("-0") == 0);
26 assert(std::stoull(L
"-0") == 0);
27 assert(std::stoull(" 10") == 10);
28 assert(std::stoull(L
" 10") == 10);
30 assert(std::stoull("10g", &idx
, 16) == 16);
33 assert(std::stoull(L
"10g", &idx
, 16) == 16);
38 std::stoull("", &idx
);
41 catch (const std::invalid_argument
&)
48 std::stoull(L
"", &idx
);
51 catch (const std::invalid_argument
&)
57 std::stoull(" - 8", &idx
);
60 catch (const std::invalid_argument
&)
66 std::stoull(L
" - 8", &idx
);
69 catch (const std::invalid_argument
&)
75 std::stoull("a1", &idx
);
78 catch (const std::invalid_argument
&)
84 std::stoull(L
"a1", &idx
);
87 catch (const std::invalid_argument
&)
94 std::stoull("9999999999999999999999999999999999999999999999999", &idx
);
97 catch (const std::out_of_range
&)
103 std::stoull(L
"9999999999999999999999999999999999999999999999999", &idx
);
106 catch (const std::out_of_range
&)