[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / clang / unittests / Tooling / RecursiveASTVisitorTests / IntegerLiteral.cpp
blob83136fc11edb2c0451e4529e8132db63627ada23
1 //===- unittest/Tooling/RecursiveASTVisitorTests/IntegerLiteral.cpp -------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "TestVisitor.h"
11 using namespace clang;
13 namespace {
15 // Check to ensure that implicit default argument expressions are visited.
16 class IntegerLiteralVisitor : public ExpectedLocationVisitor {
17 public:
18 bool VisitIntegerLiteral(IntegerLiteral *IL) override {
19 Match("literal", IL->getLocation());
20 return true;
24 TEST(RecursiveASTVisitor, DefaultArgumentsAreVisited) {
25 IntegerLiteralVisitor Visitor;
26 Visitor.ExpectMatch("literal", 1, 15, 2);
27 EXPECT_TRUE(Visitor.runOver("int f(int i = 1);\n"
28 "static int k = f();\n"));
31 } // end anonymous namespace