Skip to content

Commit

Permalink
Replace useGNUExtensions flag in test code with scanner configuration id
Browse files Browse the repository at this point in the history
Add STD and GNU scanner configuration ids and pass these as needed instead of
boolean flag useGNUExtensions. This will be used later by C++20 scanner tests.
  • Loading branch information
i-garrison authored and jonahgraham committed Jan 28, 2023
1 parent ff8ac10 commit 5622e59
Show file tree
Hide file tree
Showing 15 changed files with 321 additions and 294 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -515,55 +515,55 @@ public void testAttributeWithKeywordArgument() throws Exception {

// struct S __attribute__((__packed__)) {};
public void testGCCAttributedStruct() throws Exception {
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, true);
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU);
checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTCompositeTypeSpecifier.class);
}

// int a __attribute__ ((aligned ((64))));
public void testGCCAttributedVariableDeclarator_bug391572() throws Exception {
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, true);
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU);
checkAttributeRelations(getAttributeSpecifiers(tu), IASTDeclarator.class);
}

// struct S {
// void foo() override __attribute__((attr));
// };
public void testGCCAttributeAfterOverride_bug413615() throws Exception {
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, true);
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU);
checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTFunctionDeclarator.class);
}

// enum E {
// value1 [[attr1]], value2 [[attr2]] = 1
// };
public void testAttributedEnumerator_Bug535269() throws Exception {
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, true);
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU);
checkAttributeRelations(getAttributeSpecifiers(tu), IASTEnumerator.class, IASTEnumerator.class);
}

//void f([[attr1]] int [[attr2]] p) {
//}
public void testAttributedFunctionParameter_Bug535275() throws Exception {
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, true);
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU);
checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTParameterDeclaration.class,
ICPPASTSimpleDeclSpecifier.class);
}

//namespace [[attr]] NS {}
public void testAttributedNamedNamespace_Bug535274() throws Exception {
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, true);
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU);
checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTNamespaceDefinition.class);
}

//namespace [[attr]] {}
public void testAttributedUnnamedNamespace_Bug535274() throws Exception {
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, true);
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU);
checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTNamespaceDefinition.class);
}

//namespace NS __attribute__((__visibility__("default"))) {}
public void testGnuAndCppMixedAttributedNamedNamespace_Bug535274() throws Exception {
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, true);
IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU);
checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTNamespaceDefinition.class);
}
}
Loading

0 comments on commit 5622e59

Please sign in to comment.