Skip to content

Commit f125b5e

Browse files
author
v01dxyz
committed
tmp: fix typos, add tests
1 parent 21af94d commit f125b5e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

clang/unittests/AST/AttrTest.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ TEST(Attr, AnnotateType) {
8989
9090
// Function Type Attributes
9191
__attribute__((noreturn)) int f_noreturn();
92+
__attribute__((preserve_most)) int f_cc_preserve_most();
9293
)cpp");
9394

9495
{
@@ -161,15 +162,23 @@ TEST(Attr, AnnotateType) {
161162
const FunctionTypeLoc FTL = Func->getFunctionTypeLoc();
162163
const FunctionType *FT = FTL.getTypePtr();
163164

164-
EXPECT_TRUE(FT->getExtInfo().getNoReturn());
165+
EXPECT_TRUE(FT->getNoReturnAttr());
166+
}
167+
168+
{
169+
const FunctionDecl *Func = getFunctionNode(AST.get(), "f_cc_preserve_most");
170+
const FunctionTypeLoc FTL = Func->getFunctionTypeLoc();
171+
const FunctionType *FT = FTL.getTypePtr();
172+
173+
EXPECT_TRUE(FT->getCallConv() == CC_PreserveMost);
165174
}
166175

167176
// The following test verifies getFunctionTypeLoc returns a type
168177
// which takes into account the attribute (instead of only the nake
169178
// type).
170179
//
171180
// This is hard to do with C/C++ because it seems using a function
172-
// type attribute with a C/C++ -function declaration only results
181+
// type attribute with a C/C++ function declaration only results
173182
// with either:
174183
//
175184
// 1. It does NOT produce any AttributedType (for example it only

0 commit comments

Comments
 (0)