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 // long long stoll(const string& str, size_t *idx = 0, int base = 10);
16 // long long stoll(const wstring& str, size_t *idx = 0, int base = 10);
23 assert(std::stoll("0") == 0);
24 assert(std::stoll(L
"0") == 0);
25 assert(std::stoll("-0") == 0);
26 assert(std::stoll(L
"-0") == 0);
27 assert(std::stoll("-10") == -10);
28 assert(std::stoll(L
"-10") == -10);
29 assert(std::stoll(" 10") == 10);
30 assert(std::stoll(L
" 10") == 10);
32 assert(std::stoll("10g", &idx
, 16) == 16);
35 assert(std::stoll(L
"10g", &idx
, 16) == 16);
43 catch (const std::invalid_argument
&)
49 std::stoll(L
"", &idx
);
52 catch (const std::invalid_argument
&)
58 std::stoll(" - 8", &idx
);
61 catch (const std::invalid_argument
&)
67 std::stoll(L
" - 8", &idx
);
70 catch (const std::invalid_argument
&)
76 std::stoll("a1", &idx
);
79 catch (const std::invalid_argument
&)
85 std::stoll(L
"a1", &idx
);
88 catch (const std::invalid_argument
&)
94 std::stoll("99999999999999999999999999", &idx
);
97 catch (const std::out_of_range
&)
103 std::stoll(L
"99999999999999999999999999", &idx
);
106 catch (const std::out_of_range
&)