aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r--llvm/unittests/Support/CommandLineTest.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp
index 32dc440..41d483a5 100644
--- a/llvm/unittests/Support/CommandLineTest.cpp
+++ b/llvm/unittests/Support/CommandLineTest.cpp
@@ -375,7 +375,7 @@ TEST(CommandLineTest, AliasesWithArguments) {
{ "-tool", "-alias", "x" }
};
- for (size_t i = 0, e = array_lengthof(Inputs); i < e; ++i) {
+ for (size_t i = 0, e = std::size(Inputs); i < e; ++i) {
StackOption<std::string> Actual("actual");
StackOption<bool> Extra("extra");
StackOption<std::string> Input(cl::Positional);
@@ -404,8 +404,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(array_lengthof(opts1), opts1);
- testAliasRequired(array_lengthof(opts2), opts2);
+ testAliasRequired(std::size(opts1), opts1);
+ testAliasRequired(std::size(opts2), opts2);
}
TEST(CommandLineTest, HideUnrelatedOptions) {
@@ -455,8 +455,8 @@ TEST(CommandLineTest, HideUnrelatedOptionsMulti) {
TEST(CommandLineTest, SetMultiValues) {
StackOption<int> Option("option");
const char *args[] = {"prog", "-option=1", "-option=2"};
- EXPECT_TRUE(cl::ParseCommandLineOptions(array_lengthof(args), args,
- StringRef(), &llvm::nulls()));
+ EXPECT_TRUE(cl::ParseCommandLineOptions(std::size(args), args, StringRef(),
+ &llvm::nulls()));
EXPECT_EQ(Option, 2);
}
@@ -1032,8 +1032,8 @@ TEST(CommandLineTest, ResponseFileEOLs) {
/*CurrentDir=*/StringRef(TestRoot), FS));
const char *Expected[] = {"clang", "-Xclang", "-Wno-whatever", nullptr,
"input.cpp"};
- ASSERT_EQ(array_lengthof(Expected), Argv.size());
- for (size_t I = 0, E = array_lengthof(Expected); I < E; ++I) {
+ ASSERT_EQ(std::size(Expected), Argv.size());
+ for (size_t I = 0, E = std::size(Expected); I < E; ++I) {
if (Expected[I] == nullptr) {
ASSERT_EQ(Argv[I], nullptr);
} else {