aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
authorDavid Green <david.green@arm.com>2019-12-09 10:33:33 +0000
committerDavid Green <david.green@arm.com>2019-12-09 11:37:34 +0000
commit4a6e13ad88ddcc0ab92ace49d4c761921e7f7070 (patch)
tree4e0a5d932f04ea138bd0d1d6cf268cb685709bc0 /llvm/unittests/Support/CommandLineTest.cpp
parentb1aba0378e52be51cfb7fb6f03417ebf408d66cc (diff)
downloadllvm-4a6e13ad88ddcc0ab92ace49d4c761921e7f7070.zip
llvm-4a6e13ad88ddcc0ab92ace49d4c761921e7f7070.tar.gz
llvm-4a6e13ad88ddcc0ab92ace49d4c761921e7f7070.tar.bz2
[CommandLine] Add missing Callbacks
It appears that the cl::bits options are not used anywhere in-tree. In the recent addition to add Callback's to the options, the Callback was missing from this one. This fixes it by adding the same code from the other classes. It also adds a simple test, of sorts, just to make sure these continue compiling.
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r--llvm/unittests/Support/CommandLineTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp
index 702aa52..a435200 100644
--- a/llvm/unittests/Support/CommandLineTest.cpp
+++ b/llvm/unittests/Support/CommandLineTest.cpp
@@ -1784,4 +1784,12 @@ TEST(CommandLineTest, Callback) {
cl::ResetAllOptionOccurrences();
}
+
+enum Enum { Val1, Val2 };
+static cl::bits<Enum> ExampleBits(
+ cl::desc("An example cl::bits to ensure it compiles"),
+ cl::values(
+ clEnumValN(Val1, "bits-val1", "The Val1 value"),
+ clEnumValN(Val1, "bits-val2", "The Val2 value")));
+
} // anonymous namespace