forked from GPUOpen-Drivers/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged master:e20a215992d into amd-gfx:791da285c8e
Local branch amd-gfx 791da28 Merged master:710fa2c4ee3 into amd-gfx:ca022c58f8c Remote branch master e20a215 [ELF] Add convenience TableGen classes to enforce two dashes for options not supported by GNU ld
- Loading branch information
Showing
70 changed files
with
2,319 additions
and
3,362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...calization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t_char8_t.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// <locale> | ||
|
||
// template <> class codecvt<char16_t, char8_t, mbstate_t> | ||
|
||
// explicit codecvt(size_t refs = 0); | ||
|
||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 | ||
|
||
// C++20 codecvt specializations for char8_t are not yet implemented: | ||
// UNSUPPORTED: libc++ | ||
|
||
#include <cassert> | ||
#include <locale> | ||
|
||
using F = std::codecvt<char16_t, char8_t, std::mbstate_t>; | ||
|
||
struct my_facet : F { | ||
static int count; | ||
|
||
explicit my_facet(std::size_t refs = 0) : F(refs) { ++count; } | ||
|
||
~my_facet() { --count; } | ||
}; | ||
|
||
int my_facet::count = 0; | ||
|
||
int main(int, char**) { | ||
{ | ||
std::locale l(std::locale::classic(), new my_facet); | ||
assert(my_facet::count == 1); | ||
} | ||
assert(my_facet::count == 0); | ||
{ | ||
my_facet f(1); | ||
assert(my_facet::count == 1); | ||
{ | ||
std::locale l(std::locale::classic(), &f); | ||
assert(my_facet::count == 1); | ||
} | ||
assert(my_facet::count == 1); | ||
} | ||
assert(my_facet::count == 0); | ||
|
||
return 0; | ||
} |
53 changes: 53 additions & 0 deletions
53
...calization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t_char8_t.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// <locale> | ||
|
||
// template <> class codecvt<char32_t, char8_t, mbstate_t> | ||
|
||
// explicit codecvt(size_t refs = 0); | ||
|
||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 | ||
|
||
// C++20 codecvt specializations for char8_t are not yet implemented: | ||
// UNSUPPORTED: libc++ | ||
|
||
#include <cassert> | ||
#include <locale> | ||
|
||
using F = std::codecvt<char32_t, char8_t, std::mbstate_t>; | ||
|
||
struct my_facet : F { | ||
static int count; | ||
|
||
explicit my_facet(std::size_t refs = 0) : F(refs) { ++count; } | ||
|
||
~my_facet() { --count; } | ||
}; | ||
|
||
int my_facet::count = 0; | ||
|
||
int main(int, char**) { | ||
{ | ||
std::locale l(std::locale::classic(), new my_facet); | ||
assert(my_facet::count == 1); | ||
} | ||
assert(my_facet::count == 0); | ||
{ | ||
my_facet f(1); | ||
assert(my_facet::count == 1); | ||
{ | ||
std::locale l(std::locale::classic(), &f); | ||
assert(my_facet::count == 1); | ||
} | ||
assert(my_facet::count == 1); | ||
} | ||
assert(my_facet::count == 0); | ||
|
||
return 0; | ||
} |
29 changes: 29 additions & 0 deletions
29
...egory.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_always_noconv.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// <locale> | ||
|
||
// template <> class codecvt<char16_t, char8_t, mbstate_t> | ||
|
||
// bool always_noconv() const noexcept; | ||
|
||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 | ||
|
||
// C++20 codecvt specializations for char8_t are not yet implemented: | ||
// UNSUPPORTED: libc++ | ||
|
||
#include <cassert> | ||
#include <locale> | ||
|
||
int main(int, char**) { | ||
using F = std::codecvt<char16_t, char8_t, std::mbstate_t>; | ||
const F& f = std::use_facet<F>(std::locale::classic()); | ||
assert(!f.always_noconv()); | ||
static_assert(noexcept(f.always_noconv())); | ||
return 0; | ||
} |
29 changes: 29 additions & 0 deletions
29
...s/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_encoding.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// <locale> | ||
|
||
// template <> class codecvt<char16_t, char8_t, mbstate_t> | ||
|
||
// int encoding() const noexcept; | ||
|
||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 | ||
|
||
// C++20 codecvt specializations for char8_t are not yet implemented: | ||
// UNSUPPORTED: libc++ | ||
|
||
#include <cassert> | ||
#include <locale> | ||
|
||
int main(int, char**) { | ||
using F = std::codecvt<char16_t, char8_t, std::mbstate_t>; | ||
const F& f = std::use_facet<F>(std::locale::classic()); | ||
assert(f.encoding() == 0); | ||
static_assert(noexcept(f.encoding())); | ||
return 0; | ||
} |
39 changes: 39 additions & 0 deletions
39
...egories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_in.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// <locale> | ||
|
||
// template <> class codecvt<char16_t, char8_t, mbstate_t> | ||
|
||
// result in(stateT& state, | ||
// const externT* from, const externT* from_end, const externT*& from_next, | ||
// internT* to, internT* to_end, internT*& to_next) const; | ||
|
||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 | ||
|
||
// C++20 codecvt specializations for char8_t are not yet implemented: | ||
// UNSUPPORTED: libc++ | ||
|
||
#include <cassert> | ||
#include <locale> | ||
|
||
int main(int, char**) { | ||
using F = std::codecvt<char16_t, char8_t, std::mbstate_t>; | ||
const F::extern_type from[] = u8"some text"; | ||
F::intern_type to[9]; | ||
const F& f = std::use_facet<F>(std::locale::classic()); | ||
std::mbstate_t mbs = {}; | ||
const F::extern_type* from_next = nullptr; | ||
F::intern_type* to_next = nullptr; | ||
assert(f.in(mbs, from, from + 9, from_next, to, to + 9, to_next) == F::ok); | ||
assert(from_next - from == 9); | ||
assert(to_next - to == 9); | ||
for (unsigned i = 0; i < 9; ++i) | ||
assert(to[i] == from[i]); | ||
return 0; | ||
} |
34 changes: 34 additions & 0 deletions
34
...ies/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_length.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// <locale> | ||
|
||
// template <> class codecvt<char16_t, char8_t, mbstate_t> | ||
|
||
// int length(stateT& state, const externT* from, const externT* from_end, size_t max) const; | ||
|
||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 | ||
|
||
// C++20 codecvt specializations for char8_t are not yet implemented: | ||
// UNSUPPORTED: libc++ | ||
|
||
#include <cassert> | ||
#include <locale> | ||
|
||
int main(int, char**) { | ||
using F = std::codecvt<char16_t, char8_t, std::mbstate_t>; | ||
const F& f = std::use_facet<F>(std::locale::classic()); | ||
std::mbstate_t mbs = {}; | ||
const char8_t from[] = u8"some text"; | ||
assert(f.length(mbs, from, from + 10, 0) == 0); | ||
assert(f.length(mbs, from, from + 10, 8) == 8); | ||
assert(f.length(mbs, from, from + 10, 9) == 9); | ||
assert(f.length(mbs, from, from + 10, 10) == 10); | ||
assert(f.length(mbs, from, from + 10, 100) == 10); | ||
return 0; | ||
} |
29 changes: 29 additions & 0 deletions
29
...category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_max_length.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// <locale> | ||
|
||
// template <> class codecvt<char16_t, char8_t, mbstate_t> | ||
|
||
// int max_length() const noexcept; | ||
|
||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 | ||
|
||
// C++20 codecvt specializations for char8_t are not yet implemented: | ||
// UNSUPPORTED: libc++ | ||
|
||
#include <cassert> | ||
#include <locale> | ||
|
||
int main(int, char**) { | ||
using F = std::codecvt<char16_t, char8_t, std::mbstate_t>; | ||
const F& f = std::use_facet<F>(std::locale::classic()); | ||
assert(f.max_length() == 4); | ||
static_assert(noexcept(f.max_length())); | ||
return 0; | ||
} |
40 changes: 40 additions & 0 deletions
40
...gories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_out.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// <locale> | ||
|
||
// template <> class codecvt<char16_t, char8_t, mbstate_t> | ||
|
||
// result out(stateT& state, | ||
// const internT* from, const internT* from_end, const internT*& from_next, | ||
// externT* to, externT* to_end, externT*& to_next) const; | ||
|
||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 | ||
|
||
// C++20 codecvt specializations for char8_t are not yet implemented: | ||
// UNSUPPORTED: libc++ | ||
|
||
#include <cassert> | ||
#include <locale> | ||
|
||
int main(int, char**) { | ||
using F = std::codecvt<char16_t, char8_t, std::mbstate_t>; | ||
const F& f = std::use_facet<F>(std::locale::classic()); | ||
F::intern_type from[9] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't'}; | ||
F::extern_type to[9] = {0}; | ||
std::mbstate_t mbs = {}; | ||
const F::intern_type* from_next = nullptr; | ||
F::extern_type* to_next = nullptr; | ||
F::result r = f.out(mbs, from, from + 9, from_next, to, to + 9, to_next); | ||
assert(r == F::ok); | ||
assert(from_next - from == 9); | ||
assert(to_next - to == 9); | ||
for (unsigned i = 0; i < 9; ++i) | ||
assert(to[i] == from[i]); | ||
return 0; | ||
} |
33 changes: 33 additions & 0 deletions
33
...es/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_unshift.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// <locale> | ||
|
||
// template <> class codecvt<char16_t, char8_t, mbstate_t> | ||
|
||
// result unshift(stateT& state, | ||
// externT* to, externT* to_end, externT*& to_next) const; | ||
|
||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 | ||
|
||
// C++20 codecvt specializations for char8_t are not yet implemented: | ||
// UNSUPPORTED: libc++ | ||
|
||
#include <cassert> | ||
#include <locale> | ||
|
||
int main(int, char**) { | ||
using F = std::codecvt<char16_t, char8_t, std::mbstate_t>; | ||
const F& f = std::use_facet<F>(std::locale::classic()); | ||
std::mbstate_t mbs = {}; | ||
char8_t to[3]; | ||
char8_t* to_next = nullptr; | ||
assert(f.unshift(mbs, to, to + 3, to_next) == F::noconv); | ||
assert(to_next == to); | ||
return 0; | ||
} |
Oops, something went wrong.