}
TEST(Introspection, SourceLocations_FunctionProtoTypeLoc) {
+ if (!NodeIntrospection::hasIntrospectionSupport())
+ return;
auto AST =
buildASTFromCode(R"cpp(
int foo();
const auto *TL = BoundNodes[0].getNodeAs<TypeLoc>("tl");
auto Result = NodeIntrospection::GetLocations(*TL);
- if (Result.LocationAccessors.empty() && Result.RangeAccessors.empty()) {
- return;
- }
-
auto ExpectedLocations =
FormatExpected<SourceLocation>(Result.LocationAccessors);
}
TEST(Introspection, SourceLocations_PointerTypeLoc) {
+ if (!NodeIntrospection::hasIntrospectionSupport())
+ return;
auto AST =
buildASTFromCode(R"cpp(
int* i;
const auto *TL = BoundNodes[0].getNodeAs<TypeLoc>("tl");
auto Result = NodeIntrospection::GetLocations(*TL);
- if (Result.LocationAccessors.empty() && Result.RangeAccessors.empty()) {
- return;
- }
-
auto ExpectedLocations =
FormatExpected<SourceLocation>(Result.LocationAccessors);
#ifndef _WIN32
// This test doesn't work on windows due to use of the typeof extension.
TEST(Introspection, SourceLocations_TypeOfTypeLoc) {
+ if (!NodeIntrospection::hasIntrospectionSupport())
+ return;
auto AST =
buildASTFromCode(R"cpp(
typeof (static_cast<void *>(0)) i;
const auto *TL = BoundNodes[0].getNodeAs<TypeLoc>("tl");
auto Result = NodeIntrospection::GetLocations(*TL);
- if (Result.LocationAccessors.empty() && Result.RangeAccessors.empty()) {
- return;
- }
-
auto ExpectedLocations =
FormatExpected<SourceLocation>(Result.LocationAccessors);