aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2022-01-26 16:55:53 +0100
committerBenjamin Kramer <benny.kra@googlemail.com>2022-01-26 16:55:53 +0100
commitf15014ff549a8686671a599f7b49ce9963769eaf (patch)
treec71b273ecd3983fba8bfd6777b534c045b120619 /llvm/unittests/Support/CommandLineTest.cpp
parent297bbf106288b0d673709ca02917d82e7bebdf1a (diff)
downloadllvm-f15014ff549a8686671a599f7b49ce9963769eaf.zip
llvm-f15014ff549a8686671a599f7b49ce9963769eaf.tar.gz
llvm-f15014ff549a8686671a599f7b49ce9963769eaf.tar.bz2
Revert "Rename llvm::array_lengthof into llvm::size to match std::size from C++17"
This reverts commit ef8206320769ad31422a803a0d6de6077fd231d2. - It conflicts with the existing llvm::size in STLExtras, which will now never be called. - Calling it without llvm:: breaks C++17 compat
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r--llvm/unittests/Support/CommandLineTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp
index 695bb70..8032d0e7 100644
--- a/llvm/unittests/Support/CommandLineTest.cpp
+++ b/llvm/unittests/Support/CommandLineTest.cpp
@@ -345,7 +345,7 @@ TEST(CommandLineTest, AliasesWithArguments) {
{ "-tool", "-alias", "x" }
};
- for (size_t i = 0, e = size(Inputs); i < e; ++i) {
+ for (size_t i = 0, e = array_lengthof(Inputs); i < e; ++i) {
StackOption<std::string> Actual("actual");
StackOption<bool> Extra("extra");
StackOption<std::string> Input(cl::Positional);
@@ -374,8 +374,8 @@ void testAliasRequired(int argc, const char *const *argv) {
TEST(CommandLineTest, AliasRequired) {
const char *opts1[] = { "-tool", "-option=x" };
const char *opts2[] = { "-tool", "-o", "x" };
- testAliasRequired(size(opts1), opts1);
- testAliasRequired(size(opts2), opts2);
+ testAliasRequired(array_lengthof(opts1), opts1);
+ testAliasRequired(array_lengthof(opts2), opts2);
}
TEST(CommandLineTest, HideUnrelatedOptions) {
@@ -987,8 +987,8 @@ TEST(CommandLineTest, ResponseFileEOLs) {
/*CurrentDir=*/StringRef(TestRoot), FS));
const char *Expected[] = {"clang", "-Xclang", "-Wno-whatever", nullptr,
"input.cpp"};
- ASSERT_EQ(size(Expected), Argv.size());
- for (size_t I = 0, E = size(Expected); I < E; ++I) {
+ ASSERT_EQ(array_lengthof(Expected), Argv.size());
+ for (size_t I = 0, E = array_lengthof(Expected); I < E; ++I) {
if (Expected[I] == nullptr) {
ASSERT_EQ(Argv[I], nullptr);
} else {