1 //===- unittest/Tooling/RecursiveASTVisitorTests/IntegerLiteral.cpp -------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "TestVisitor.h"
12 using namespace clang;
16 // Check to ensure that implicit default argument expressions are visited.
17 class IntegerLiteralVisitor
18 : public ExpectedLocationVisitor<IntegerLiteralVisitor> {
20 bool VisitIntegerLiteral(const IntegerLiteral *IL) {
21 Match("literal", IL->getLocation());
26 TEST(RecursiveASTVisitor, DefaultArgumentsAreVisited) {
27 IntegerLiteralVisitor Visitor;
28 Visitor.ExpectMatch("literal", 1, 15, 2);
29 EXPECT_TRUE(Visitor.runOver("int f(int i = 1);\n"
30 "static int k = f();\n"));
33 } // end anonymous namespace