diff --git a/clang/include/clang/3C/ConstraintVariables.h b/clang/include/clang/3C/ConstraintVariables.h index 4d8428d0f5cf..7641fdccb745 100644 --- a/clang/include/clang/3C/ConstraintVariables.h +++ b/clang/include/clang/3C/ConstraintVariables.h @@ -130,6 +130,7 @@ class ConstraintVariable { // Here, AIdx is the pointer level which needs to be checked. // By default, we check for all pointer levels (or VarAtoms) virtual bool hasWild(const EnvironmentMap &E, int AIdx = -1) const = 0; + virtual bool hasParamWild(const EnvironmentMap &E) const = 0; virtual bool hasArr(const EnvironmentMap &E, int AIdx = -1) const = 0; virtual bool hasNtArr(const EnvironmentMap &E, int AIdx = -1) const = 0; @@ -416,6 +417,7 @@ class PointerVariableConstraint : public ConstraintVariable { bool anyChanges(const EnvironmentMap &E) const override; bool anyArgumentIsWild(const EnvironmentMap &E); bool hasWild(const EnvironmentMap &E, int AIdx = -1) const override; + bool hasParamWild(const EnvironmentMap &E) const override; bool hasArr(const EnvironmentMap &E, int AIdx = -1) const override; bool hasNtArr(const EnvironmentMap &E, int AIdx = -1) const override; @@ -476,6 +478,7 @@ class FVComponentVariable { bool hasItypeSolution(Constraints &CS) const; bool hasCheckedSolution(Constraints &CS) const; + bool hasWild(const EnvironmentMap &E) const; PVConstraint *getInternal() const { return InternalConstraint; } PVConstraint *getExternal() const { return ExternalConstraint; } @@ -585,6 +588,7 @@ class FunctionVariableConstraint : public ConstraintVariable { PersistentSourceLoc *PL) const override; bool anyChanges(const EnvironmentMap &E) const override; bool hasWild(const EnvironmentMap &E, int AIdx = -1) const override; + bool hasParamWild(const EnvironmentMap &E) const override; bool hasArr(const EnvironmentMap &E, int AIdx = -1) const override; bool hasNtArr(const EnvironmentMap &E, int AIdx = -1) const override; diff --git a/clang/lib/3C/CheckedRegions.cpp b/clang/lib/3C/CheckedRegions.cpp index 28a2eadc6d07..19960b6727f3 100644 --- a/clang/lib/3C/CheckedRegions.cpp +++ b/clang/lib/3C/CheckedRegions.cpp @@ -227,9 +227,10 @@ bool CheckedRegionFinder::VisitCallExpr(CallExpr *C) { if (Info.hasTypeParamBindings(C,Context)) for (auto Entry : Info.getTypeParamBindings(C, Context)) Wild |= (Entry.second == nullptr); - auto Type = FD->getReturnType(); + const auto IT = FD->getInteropType(); + const auto Type = FD->getReturnType(); Wild |= (!(FD->hasPrototype() || FD->doesThisDeclarationHaveABody())) || - containsUncheckedPtr(Type); + containsUncheckedPtr(IT.getTypePtrOrNull() ? IT : Type); auto *FV = Info.getFuncConstraint(FD, Context); for (unsigned I = 0; I < FV->numParams(); I++) Wild |= isWild(*FV->getExternalParam(I)); @@ -272,8 +273,7 @@ bool CheckedRegionFinder::VisitDeclRefExpr(DeclRefExpr *DR) { auto T = DR->getType(); auto *D = DR->getDecl(); CVarOption CV = Info.getVariable(D, Context); - bool IW = isWild(CV) || containsUncheckedPtr(T); - + bool IW = false; if (auto *FD = dyn_cast(D)) { auto *FV = Info.getFuncConstraint(FD, Context); IW |= FV->hasWild(Info.getConstraints().getVariables()); @@ -281,7 +281,8 @@ bool CheckedRegionFinder::VisitDeclRefExpr(DeclRefExpr *DR) { PVConstraint *ParamCV = FV->getExternalParam(I); IW |= isWild(*ParamCV); } - } + } else + IW = isWild(CV) || containsUncheckedPtr(T); Wild |= IW; return true; @@ -340,10 +341,11 @@ bool CheckedRegionFinder::isInStatementPosition(CallExpr *C) { } bool CheckedRegionFinder::isWild(CVarOption Cv) { - if (Cv.hasValue() && - Cv.getValue().hasWild(Info.getConstraints().getVariables())) - return true; - return false; + const auto &E = Info.getConstraints().getVariables(); + if (Cv.hasValue()) + return Cv.getValue().hasWild(E) || Cv.getValue().hasParamWild(E); + else + return false; } bool CheckedRegionFinder::containsUncheckedPtr(QualType Qt) { diff --git a/clang/lib/3C/ConstraintVariables.cpp b/clang/lib/3C/ConstraintVariables.cpp index a26dbb231b6e..4f8b0c70deb1 100644 --- a/clang/lib/3C/ConstraintVariables.cpp +++ b/clang/lib/3C/ConstraintVariables.cpp @@ -16,6 +16,7 @@ #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/CommandLine.h" #include +#include using namespace clang; // Macro for boolean implication. @@ -1049,11 +1050,15 @@ bool FunctionVariableConstraint::anyChanges(const EnvironmentMap &E) const { return CV.ExternalConstraint->anyChanges(E); }); } - bool FunctionVariableConstraint::hasWild(const EnvironmentMap &E, int AIdx) const { return ReturnVar.ExternalConstraint->hasWild(E, AIdx); } +bool FunctionVariableConstraint::hasParamWild(const EnvironmentMap &E) const { + return std::any_of(this->ParamVars.begin(), this->ParamVars.end(), + [&E](const auto V) { return V.hasWild(E); } ); +} + bool FunctionVariableConstraint::hasArr(const EnvironmentMap &E, int AIdx) const { @@ -1241,6 +1246,13 @@ bool PointerVariableConstraint::hasWild(const EnvironmentMap &E, return false; } +bool PointerVariableConstraint::hasParamWild(const EnvironmentMap &E) const { + if (const auto *TFV = this->getFV()) + return TFV->hasParamWild(E); + else + return false; +} + bool PointerVariableConstraint::hasArr(const EnvironmentMap &E, int AIdx) const { int VarIdx = 0; @@ -1915,6 +1927,10 @@ std::string FVComponentVariable::mkItypeStr(Constraints &CS) const { return ""; } +bool FVComponentVariable::hasWild(const EnvironmentMap &E) const { + return InternalConstraint->hasWild(E); +} + bool FVComponentVariable::hasCheckedSolution(Constraints &CS) const { // If the external constraint variable is checked, then the variable should // be advertised as checked to callers. If the internal and external diff --git a/clang/test/3C/3d-allocation.c b/clang/test/3C/3d-allocation.c index 9c80f6b427a7..2eeb51fd2eed 100644 --- a/clang/test/3C/3d-allocation.c +++ b/clang/test/3C/3d-allocation.c @@ -13,7 +13,7 @@ extern _Itype_for_any(T) void *malloc(size_t size) int ***malloc3d(int y, int x, int z) { //CHECK_NOALL: int ***malloc3d(int y, int x, int z) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr<_Array_ptr<_Array_ptr>> malloc3d(int y, int x, int z) : count(y) { + //CHECK_ALL: _Array_ptr<_Array_ptr<_Array_ptr>> malloc3d(int y, int x, int z) : count(y) _Checked { int i, j; diff --git a/clang/test/3C/arrboth.c b/clang/test/3C/arrboth.c index 25fa1f01c893..d48f685d2197 100644 --- a/clang/test/3C/arrboth.c +++ b/clang/test/3C/arrboth.c @@ -133,8 +133,8 @@ int *sus(int *x, int *y) { } int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); @@ -147,7 +147,7 @@ int *foo() { int *bar() { //CHECK_NOALL: int *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_ALL: _Array_ptr bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); diff --git a/clang/test/3C/arrbothmulti1.c b/clang/test/3C/arrbothmulti1.c index 74382ff2d43d..09cf028193fd 100644 --- a/clang/test/3C/arrbothmulti1.c +++ b/clang/test/3C/arrbothmulti1.c @@ -123,8 +123,8 @@ int *sus(int *, int *); //CHECK_ALL: _Array_ptr sus(int *x : itype(_Ptr), _Ptr y); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); @@ -137,7 +137,7 @@ int *foo() { int *bar() { //CHECK_NOALL: int *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_ALL: _Array_ptr bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); diff --git a/clang/test/3C/arrcallee.c b/clang/test/3C/arrcallee.c index fca7bbeeb703..3d04642e4655 100644 --- a/clang/test/3C/arrcallee.c +++ b/clang/test/3C/arrcallee.c @@ -133,8 +133,8 @@ int *sus(int *x, int *y) { } int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); @@ -146,8 +146,8 @@ int *foo() { } int *bar() { - //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) _Checked { + //CHECK_ALL: _Array_ptr bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); diff --git a/clang/test/3C/arrcalleemulti1.c b/clang/test/3C/arrcalleemulti1.c index fdb735db2f33..91a3310c18e2 100644 --- a/clang/test/3C/arrcalleemulti1.c +++ b/clang/test/3C/arrcalleemulti1.c @@ -123,8 +123,8 @@ int *sus(int *, int *); //CHECK_ALL: _Array_ptr sus(int *x : itype(_Ptr), _Ptr y); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); @@ -136,8 +136,8 @@ int *foo() { } int *bar() { - //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) _Checked { + //CHECK_ALL: _Array_ptr bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); diff --git a/clang/test/3C/arrcaller.c b/clang/test/3C/arrcaller.c index 479abd96fb28..95b9efcfda55 100644 --- a/clang/test/3C/arrcaller.c +++ b/clang/test/3C/arrcaller.c @@ -132,8 +132,8 @@ int *sus(int *x, int *y) { } int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) : count(5) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); @@ -146,7 +146,7 @@ int *foo() { int *bar() { //CHECK_NOALL: int *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_ALL: _Array_ptr bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); diff --git a/clang/test/3C/arrcallermulti1.c b/clang/test/3C/arrcallermulti1.c index 61c770900d35..38deb1ee387f 100644 --- a/clang/test/3C/arrcallermulti1.c +++ b/clang/test/3C/arrcallermulti1.c @@ -123,8 +123,8 @@ int *sus(int *, int *); //CHECK_ALL: _Array_ptr sus(int *x : itype(_Ptr), _Ptr y) : count(5); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) : count(5) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); @@ -137,7 +137,7 @@ int *foo() { int *bar() { //CHECK_NOALL: int *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_ALL: _Array_ptr bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); diff --git a/clang/test/3C/arrinstructprotosafe.c b/clang/test/3C/arrinstructprotosafe.c index aadf3024cb12..b6e39fcd4aa7 100644 --- a/clang/test/3C/arrinstructprotosafe.c +++ b/clang/test/3C/arrinstructprotosafe.c @@ -118,7 +118,8 @@ struct warr *sus(struct warr *, struct warr *); //CHECK: _Ptr sus(struct warr *x : itype(_Ptr), _Ptr y); struct warr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct warr *x = malloc(sizeof(struct warr)); //CHECK: _Ptr x = malloc(sizeof(struct warr)); struct warr *y = malloc(sizeof(struct warr)); @@ -129,7 +130,8 @@ struct warr *foo() { } struct warr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct warr *x = malloc(sizeof(struct warr)); //CHECK: _Ptr x = malloc(sizeof(struct warr)); struct warr *y = malloc(sizeof(struct warr)); diff --git a/clang/test/3C/arrinstructsafe.c b/clang/test/3C/arrinstructsafe.c index 74db580240de..9c360a746552 100644 --- a/clang/test/3C/arrinstructsafe.c +++ b/clang/test/3C/arrinstructsafe.c @@ -130,7 +130,8 @@ struct warr *sus(struct warr *x, struct warr *y) { } struct warr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct warr *x = malloc(sizeof(struct warr)); //CHECK: _Ptr x = malloc(sizeof(struct warr)); struct warr *y = malloc(sizeof(struct warr)); @@ -141,7 +142,8 @@ struct warr *foo() { } struct warr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct warr *x = malloc(sizeof(struct warr)); //CHECK: _Ptr x = malloc(sizeof(struct warr)); struct warr *y = malloc(sizeof(struct warr)); diff --git a/clang/test/3C/arrinstructsafemulti1.c b/clang/test/3C/arrinstructsafemulti1.c index c6e2efc7e439..43f17b27d27d 100644 --- a/clang/test/3C/arrinstructsafemulti1.c +++ b/clang/test/3C/arrinstructsafemulti1.c @@ -121,7 +121,8 @@ struct warr *sus(struct warr *, struct warr *); //CHECK: _Ptr sus(struct warr *x : itype(_Ptr), _Ptr y); struct warr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct warr *x = malloc(sizeof(struct warr)); //CHECK: _Ptr x = malloc(sizeof(struct warr)); struct warr *y = malloc(sizeof(struct warr)); @@ -132,7 +133,8 @@ struct warr *foo() { } struct warr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct warr *x = malloc(sizeof(struct warr)); //CHECK: _Ptr x = malloc(sizeof(struct warr)); struct warr *y = malloc(sizeof(struct warr)); diff --git a/clang/test/3C/arrofstructboth.c b/clang/test/3C/arrofstructboth.c index 9487cf921808..c56ef1677cc9 100644 --- a/clang/test/3C/arrofstructboth.c +++ b/clang/test/3C/arrofstructboth.c @@ -137,7 +137,7 @@ struct general **sus(struct general *x, struct general *y) { struct general **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -161,7 +161,7 @@ struct general **foo() { struct general **bar() { //CHECK_NOALL: struct general **bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/arrofstructbothmulti1.c b/clang/test/3C/arrofstructbothmulti1.c index ba1f3196be67..ba4e0807807d 100644 --- a/clang/test/3C/arrofstructbothmulti1.c +++ b/clang/test/3C/arrofstructbothmulti1.c @@ -124,7 +124,7 @@ struct general **sus(struct general *, struct general *); struct general **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -134,6 +134,8 @@ struct general **foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -146,7 +148,7 @@ struct general **foo() { struct general **bar() { //CHECK_NOALL: struct general **bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -156,6 +158,8 @@ struct general **bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/arrofstructcallee.c b/clang/test/3C/arrofstructcallee.c index 6115205c4d35..47d5970b4b37 100644 --- a/clang/test/3C/arrofstructcallee.c +++ b/clang/test/3C/arrofstructcallee.c @@ -137,7 +137,7 @@ struct general **sus(struct general *x, struct general *y) { struct general **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -161,7 +161,7 @@ struct general **foo() { struct general **bar() { //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/arrofstructcalleemulti1.c b/clang/test/3C/arrofstructcalleemulti1.c index 5e27a49400da..49d329ef7d95 100644 --- a/clang/test/3C/arrofstructcalleemulti1.c +++ b/clang/test/3C/arrofstructcalleemulti1.c @@ -124,7 +124,7 @@ struct general **sus(struct general *, struct general *); struct general **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -134,6 +134,8 @@ struct general **foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -146,7 +148,7 @@ struct general **foo() { struct general **bar() { //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -156,6 +158,8 @@ struct general **bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/arrofstructcaller.c b/clang/test/3C/arrofstructcaller.c index 7288a05cde85..d6c6da438951 100644 --- a/clang/test/3C/arrofstructcaller.c +++ b/clang/test/3C/arrofstructcaller.c @@ -136,7 +136,7 @@ struct general **sus(struct general *x, struct general *y) { struct general **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -160,7 +160,7 @@ struct general **foo() { struct general **bar() { //CHECK_NOALL: struct general **bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/arrofstructcallermulti1.c b/clang/test/3C/arrofstructcallermulti1.c index 9487aac47f44..ff7af0e9588b 100644 --- a/clang/test/3C/arrofstructcallermulti1.c +++ b/clang/test/3C/arrofstructcallermulti1.c @@ -124,7 +124,7 @@ struct general **sus(struct general *, struct general *); struct general **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -134,6 +134,8 @@ struct general **foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -146,7 +148,7 @@ struct general **foo() { struct general **bar() { //CHECK_NOALL: struct general **bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -156,6 +158,8 @@ struct general **bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/arrofstructprotoboth.c b/clang/test/3C/arrofstructprotoboth.c index 481967b101e5..202ea670aaac 100644 --- a/clang/test/3C/arrofstructprotoboth.c +++ b/clang/test/3C/arrofstructprotoboth.c @@ -122,7 +122,7 @@ struct general **sus(struct general *, struct general *); struct general **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -146,7 +146,7 @@ struct general **foo() { struct general **bar() { //CHECK_NOALL: struct general **bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/arrofstructprotocallee.c b/clang/test/3C/arrofstructprotocallee.c index c5329a76a719..d3eaee5062d2 100644 --- a/clang/test/3C/arrofstructprotocallee.c +++ b/clang/test/3C/arrofstructprotocallee.c @@ -122,7 +122,7 @@ struct general **sus(struct general *, struct general *); struct general **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -146,7 +146,7 @@ struct general **foo() { struct general **bar() { //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/arrofstructprotocaller.c b/clang/test/3C/arrofstructprotocaller.c index baab2d55baf8..7c3cf9787d73 100644 --- a/clang/test/3C/arrofstructprotocaller.c +++ b/clang/test/3C/arrofstructprotocaller.c @@ -122,7 +122,7 @@ struct general **sus(struct general *, struct general *); struct general **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -146,7 +146,7 @@ struct general **foo() { struct general **bar() { //CHECK_NOALL: struct general **bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/arrofstructprotosafe.c b/clang/test/3C/arrofstructprotosafe.c index d8c775cf72b1..abe8a51c3da4 100644 --- a/clang/test/3C/arrofstructprotosafe.c +++ b/clang/test/3C/arrofstructprotosafe.c @@ -121,7 +121,7 @@ struct general **sus(struct general *, struct general *); struct general **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -145,7 +145,7 @@ struct general **foo() { struct general **bar() { //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/arrofstructsafe.c b/clang/test/3C/arrofstructsafe.c index 44fdd51e32d5..eb2a233d0193 100644 --- a/clang/test/3C/arrofstructsafe.c +++ b/clang/test/3C/arrofstructsafe.c @@ -135,7 +135,7 @@ struct general **sus(struct general *x, struct general *y) { struct general **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -159,7 +159,7 @@ struct general **foo() { struct general **bar() { //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/arrofstructsafemulti1.c b/clang/test/3C/arrofstructsafemulti1.c index 6ebc68e17e11..8de2a4c7dcc6 100644 --- a/clang/test/3C/arrofstructsafemulti1.c +++ b/clang/test/3C/arrofstructsafemulti1.c @@ -123,7 +123,7 @@ struct general **sus(struct general *, struct general *); struct general **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -133,6 +133,8 @@ struct general **foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -145,7 +147,7 @@ struct general **foo() { struct general **bar() { //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -155,6 +157,8 @@ struct general **bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/arrprotoboth.c b/clang/test/3C/arrprotoboth.c index 651ec7449f1d..1374301ea4fa 100644 --- a/clang/test/3C/arrprotoboth.c +++ b/clang/test/3C/arrprotoboth.c @@ -120,8 +120,8 @@ int *sus(int *, int *); //CHECK_ALL: _Array_ptr sus(int *x : itype(_Ptr), _Ptr y); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); @@ -134,7 +134,7 @@ int *foo() { int *bar() { //CHECK_NOALL: int *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_ALL: _Array_ptr bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); diff --git a/clang/test/3C/arrprotocallee.c b/clang/test/3C/arrprotocallee.c index 2f80b0d30a41..46f0f24cc3d4 100644 --- a/clang/test/3C/arrprotocallee.c +++ b/clang/test/3C/arrprotocallee.c @@ -120,8 +120,8 @@ int *sus(int *, int *); //CHECK_ALL: _Array_ptr sus(int *x : itype(_Ptr), _Ptr y); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); @@ -133,8 +133,8 @@ int *foo() { } int *bar() { - //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) _Checked { + //CHECK_ALL: _Array_ptr bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); diff --git a/clang/test/3C/arrprotocaller.c b/clang/test/3C/arrprotocaller.c index 92a655960ce0..d1c5008785b6 100644 --- a/clang/test/3C/arrprotocaller.c +++ b/clang/test/3C/arrprotocaller.c @@ -120,8 +120,8 @@ int *sus(int *, int *); //CHECK_ALL: _Array_ptr sus(int *x : itype(_Ptr), _Ptr y) : count(5); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) : count(5) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); @@ -134,7 +134,7 @@ int *foo() { int *bar() { //CHECK_NOALL: int *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_ALL: _Array_ptr bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); diff --git a/clang/test/3C/arrprotosafe.c b/clang/test/3C/arrprotosafe.c index 8e0323df2246..d8e852b487da 100644 --- a/clang/test/3C/arrprotosafe.c +++ b/clang/test/3C/arrprotosafe.c @@ -119,8 +119,8 @@ int *sus(int *, int *); //CHECK_ALL: _Array_ptr sus(int *x : itype(_Ptr), _Ptr y) : count(5); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) : count(5) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); @@ -132,8 +132,8 @@ int *foo() { } int *bar() { - //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr bar(void) : count(5) { + //CHECK_NOALL: _Ptr bar(void) _Checked { + //CHECK_ALL: _Array_ptr bar(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); diff --git a/clang/test/3C/arrsafe.c b/clang/test/3C/arrsafe.c index cce4e38a5360..c2bf0bae6c39 100644 --- a/clang/test/3C/arrsafe.c +++ b/clang/test/3C/arrsafe.c @@ -131,8 +131,8 @@ int *sus(int *x, int *y) { } int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) : count(5) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); @@ -144,8 +144,8 @@ int *foo() { } int *bar() { - //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr bar(void) : count(5) { + //CHECK_NOALL: _Ptr bar(void) _Checked { + //CHECK_ALL: _Array_ptr bar(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); diff --git a/clang/test/3C/arrsafemulti1.c b/clang/test/3C/arrsafemulti1.c index bdca41b23ffc..c59440bf898c 100644 --- a/clang/test/3C/arrsafemulti1.c +++ b/clang/test/3C/arrsafemulti1.c @@ -122,8 +122,8 @@ int *sus(int *, int *); //CHECK_ALL: _Array_ptr sus(int *x : itype(_Ptr), _Ptr y) : count(5); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) : count(5) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); @@ -135,8 +135,8 @@ int *foo() { } int *bar() { - //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr bar(void) : count(5) { + //CHECK_NOALL: _Ptr bar(void) _Checked { + //CHECK_ALL: _Array_ptr bar(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); int *y = malloc(sizeof(int)); diff --git a/clang/test/3C/arrstructboth.c b/clang/test/3C/arrstructboth.c index 1007f4a8d4d5..578e766b3b95 100644 --- a/clang/test/3C/arrstructboth.c +++ b/clang/test/3C/arrstructboth.c @@ -133,8 +133,8 @@ int *sus(struct general *x, struct general *y) { } int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -156,7 +156,7 @@ int *foo() { int *bar() { //CHECK_NOALL: int *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_ALL: _Array_ptr bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -166,6 +166,8 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/arrstructbothmulti1.c b/clang/test/3C/arrstructbothmulti1.c index c6f9657a460d..28ba9a918033 100644 --- a/clang/test/3C/arrstructbothmulti1.c +++ b/clang/test/3C/arrstructbothmulti1.c @@ -123,8 +123,8 @@ int *sus(struct general *, struct general *); //CHECK_ALL: _Array_ptr sus(struct general *x : itype(_Ptr), _Ptr y); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -146,7 +146,7 @@ int *foo() { int *bar() { //CHECK_NOALL: int *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_ALL: _Array_ptr bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -156,6 +156,8 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/arrstructcallee.c b/clang/test/3C/arrstructcallee.c index 9b6e25620590..f67a1b6fd70f 100644 --- a/clang/test/3C/arrstructcallee.c +++ b/clang/test/3C/arrstructcallee.c @@ -133,8 +133,8 @@ int *sus(struct general *x, struct general *y) { } int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -155,8 +155,8 @@ int *foo() { } int *bar() { - //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) _Checked { + //CHECK_ALL: _Array_ptr bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/arrstructcalleemulti1.c b/clang/test/3C/arrstructcalleemulti1.c index 8991823cadac..77cdc4f3562d 100644 --- a/clang/test/3C/arrstructcalleemulti1.c +++ b/clang/test/3C/arrstructcalleemulti1.c @@ -123,8 +123,8 @@ int *sus(struct general *, struct general *); //CHECK_ALL: _Array_ptr sus(struct general *x : itype(_Ptr), _Ptr y); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -145,8 +145,8 @@ int *foo() { } int *bar() { - //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) _Checked { + //CHECK_ALL: _Array_ptr bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/arrstructcaller.c b/clang/test/3C/arrstructcaller.c index 55b057604db9..18f8173b0545 100644 --- a/clang/test/3C/arrstructcaller.c +++ b/clang/test/3C/arrstructcaller.c @@ -132,8 +132,8 @@ int *sus(struct general *x, struct general *y) { } int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) : count(5) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -155,7 +155,7 @@ int *foo() { int *bar() { //CHECK_NOALL: int *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_ALL: _Array_ptr bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -165,6 +165,8 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/arrstructcallermulti1.c b/clang/test/3C/arrstructcallermulti1.c index 131894654eee..facacf683cfa 100644 --- a/clang/test/3C/arrstructcallermulti1.c +++ b/clang/test/3C/arrstructcallermulti1.c @@ -123,8 +123,8 @@ int *sus(struct general *, struct general *); //CHECK_ALL: _Array_ptr sus(struct general *x : itype(_Ptr), _Ptr y) : count(5); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) : count(5) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -146,7 +146,7 @@ int *foo() { int *bar() { //CHECK_NOALL: int *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_ALL: _Array_ptr bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -156,6 +156,8 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/arrstructprotoboth.c b/clang/test/3C/arrstructprotoboth.c index 423e027ed99e..8c1a719b7c6b 100644 --- a/clang/test/3C/arrstructprotoboth.c +++ b/clang/test/3C/arrstructprotoboth.c @@ -120,8 +120,8 @@ int *sus(struct general *, struct general *); //CHECK_ALL: _Array_ptr sus(struct general *x : itype(_Ptr), _Ptr y); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -143,7 +143,7 @@ int *foo() { int *bar() { //CHECK_NOALL: int *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_ALL: _Array_ptr bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -153,6 +153,8 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/arrstructprotocallee.c b/clang/test/3C/arrstructprotocallee.c index 9b191ab7895e..efe6d7b57e18 100644 --- a/clang/test/3C/arrstructprotocallee.c +++ b/clang/test/3C/arrstructprotocallee.c @@ -120,8 +120,8 @@ int *sus(struct general *, struct general *); //CHECK_ALL: _Array_ptr sus(struct general *x : itype(_Ptr), _Ptr y); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -142,8 +142,8 @@ int *foo() { } int *bar() { - //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) _Checked { + //CHECK_ALL: _Array_ptr bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/arrstructprotocaller.c b/clang/test/3C/arrstructprotocaller.c index b724fd0d2635..4ddca1f8dcda 100644 --- a/clang/test/3C/arrstructprotocaller.c +++ b/clang/test/3C/arrstructprotocaller.c @@ -120,8 +120,8 @@ int *sus(struct general *, struct general *); //CHECK_ALL: _Array_ptr sus(struct general *x : itype(_Ptr), _Ptr y) : count(5); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) : count(5) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -143,7 +143,7 @@ int *foo() { int *bar() { //CHECK_NOALL: int *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_ALL: _Array_ptr bar(void) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -153,6 +153,8 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK_NOALL: for (i = 1; i < 5; i++, curr = curr->next) _Checked { + //CHECK_ALL: for (i = 1; i < 5; i++, curr = curr->next) { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/arrstructprotosafe.c b/clang/test/3C/arrstructprotosafe.c index 6a1a5805c9d3..29de677f3d08 100644 --- a/clang/test/3C/arrstructprotosafe.c +++ b/clang/test/3C/arrstructprotosafe.c @@ -119,8 +119,8 @@ int *sus(struct general *, struct general *); //CHECK_ALL: _Array_ptr sus(struct general *x : itype(_Ptr), _Ptr y) : count(5); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) : count(5) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -141,8 +141,8 @@ int *foo() { } int *bar() { - //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr bar(void) : count(5) { + //CHECK_NOALL: _Ptr bar(void) _Checked { + //CHECK_ALL: _Array_ptr bar(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/arrstructsafe.c b/clang/test/3C/arrstructsafe.c index 5fc431059190..eedac51f0823 100644 --- a/clang/test/3C/arrstructsafe.c +++ b/clang/test/3C/arrstructsafe.c @@ -131,8 +131,8 @@ int *sus(struct general *x, struct general *y) { } int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) : count(5) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -153,8 +153,8 @@ int *foo() { } int *bar() { - //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr bar(void) : count(5) { + //CHECK_NOALL: _Ptr bar(void) _Checked { + //CHECK_ALL: _Array_ptr bar(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/arrstructsafemulti1.c b/clang/test/3C/arrstructsafemulti1.c index 3e84969d92de..3e6b5495a9db 100644 --- a/clang/test/3C/arrstructsafemulti1.c +++ b/clang/test/3C/arrstructsafemulti1.c @@ -122,8 +122,8 @@ int *sus(struct general *, struct general *); //CHECK_ALL: _Array_ptr sus(struct general *x : itype(_Ptr), _Ptr y) : count(5); int *foo() { - //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr foo(void) : count(5) { + //CHECK_NOALL: _Ptr foo(void) _Checked { + //CHECK_ALL: _Array_ptr foo(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); @@ -144,8 +144,8 @@ int *foo() { } int *bar() { - //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr bar(void) : count(5) { + //CHECK_NOALL: _Ptr bar(void) _Checked { + //CHECK_ALL: _Array_ptr bar(void) : count(5) _Checked { struct general *x = malloc(sizeof(struct general)); //CHECK: _Ptr x = malloc(sizeof(struct general)); struct general *y = malloc(sizeof(struct general)); diff --git a/clang/test/3C/b13_calleestructp.c b/clang/test/3C/b13_calleestructp.c index 14b3143b2dcf..dba9c38675c7 100644 --- a/clang/test/3C/b13_calleestructp.c +++ b/clang/test/3C/b13_calleestructp.c @@ -40,6 +40,8 @@ struct r { }; struct p sus(struct p x) { + //CHECK_NOALL: struct p sus(struct p x) { + //CHECK_ALL: struct p sus(struct p x) _Checked { x.x += 1; struct p *n = malloc(sizeof(struct p)); //CHECK: _Ptr n = malloc(sizeof(struct p)); diff --git a/clang/test/3C/b14_callerstructp.c b/clang/test/3C/b14_callerstructp.c index 7c21598c9c91..8e59b69af523 100644 --- a/clang/test/3C/b14_callerstructp.c +++ b/clang/test/3C/b14_callerstructp.c @@ -40,6 +40,8 @@ struct r { }; struct p sus(struct p x) { + //CHECK_NOALL: struct p sus(struct p x) { + //CHECK_ALL: struct p sus(struct p x) _Checked { struct p *n = malloc(sizeof(struct p)); //CHECK: _Ptr n = malloc(sizeof(struct p)); return *n; diff --git a/clang/test/3C/b18_bothstructp.c b/clang/test/3C/b18_bothstructp.c index eda2e50c2a50..6b4351756ec8 100644 --- a/clang/test/3C/b18_bothstructp.c +++ b/clang/test/3C/b18_bothstructp.c @@ -40,6 +40,8 @@ struct r { }; struct p sus(struct p x) { + //CHECK_NOALL: struct p sus(struct p x) { + //CHECK_ALL: struct p sus(struct p x) _Checked { x.x += 1; struct p *n = malloc(sizeof(struct p)); //CHECK: _Ptr n = malloc(sizeof(struct p)); diff --git a/clang/test/3C/b1_allsafe.c b/clang/test/3C/b1_allsafe.c index 2d10889c8eed..ad1352395845 100644 --- a/clang/test/3C/b1_allsafe.c +++ b/clang/test/3C/b1_allsafe.c @@ -22,7 +22,7 @@ extern _Unchecked char *strcpy(char *restrict dest, const char *restrict src int *sus(int *x, int *y) { //CHECK_NOALL: _Ptr sus(int *x : itype(_Ptr), _Ptr y) { - //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) { + //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) _Checked { int *z = malloc(sizeof(int)); //CHECK: _Ptr z = malloc(sizeof(int)); *z = 1; diff --git a/clang/test/3C/b23_explicitunsafecast.c b/clang/test/3C/b23_explicitunsafecast.c index f6f35a6879b6..7155f3ec3bb0 100644 --- a/clang/test/3C/b23_explicitunsafecast.c +++ b/clang/test/3C/b23_explicitunsafecast.c @@ -22,7 +22,7 @@ extern _Unchecked char *strcpy(char *restrict dest, const char *restrict src int *sus(int *x, int *y) { //CHECK_NOALL: _Ptr sus(int *x : itype(_Ptr), _Ptr y) { - //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) { + //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) _Checked { int *z = malloc(sizeof(int)); //CHECK: _Ptr z = malloc(sizeof(int)); *z = 1; diff --git a/clang/test/3C/b24_implicitunsafecast.c b/clang/test/3C/b24_implicitunsafecast.c index 105c9eb6572b..a9d5c030a481 100644 --- a/clang/test/3C/b24_implicitunsafecast.c +++ b/clang/test/3C/b24_implicitunsafecast.c @@ -22,7 +22,7 @@ extern _Unchecked char *strcpy(char *restrict dest, const char *restrict src int *sus(int *x, int *y) { //CHECK_NOALL: _Ptr sus(int *x : itype(_Ptr), _Ptr y) { - //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) { + //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) _Checked { int *z = malloc(sizeof(int)); //CHECK: _Ptr z = malloc(sizeof(int)); *z = 1; diff --git a/clang/test/3C/b24_retswitchimplicit.c b/clang/test/3C/b24_retswitchimplicit.c index b34a4d5a2b3f..8e4a6245aa6a 100644 --- a/clang/test/3C/b24_retswitchimplicit.c +++ b/clang/test/3C/b24_retswitchimplicit.c @@ -22,7 +22,7 @@ extern _Unchecked char *strcpy(char *restrict dest, const char *restrict src char *sus(int *x, int *y) { //CHECK_NOALL: _Ptr sus(int *x : itype(_Ptr), _Ptr y) { - //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) { + //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) _Checked { char *z = malloc(sizeof(char)); //CHECK: _Ptr z = malloc(sizeof(char)); *z = 1; diff --git a/clang/test/3C/b25_castprotosafe.c b/clang/test/3C/b25_castprotosafe.c index f854317baf67..ab81eba93e87 100644 --- a/clang/test/3C/b25_castprotosafe.c +++ b/clang/test/3C/b25_castprotosafe.c @@ -55,7 +55,7 @@ int *bar() { int *sus(int *x, int *y) { //CHECK_NOALL: _Ptr sus(int *x : itype(_Ptr), _Ptr y) { - //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) { + //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) _Checked { int *z = malloc(sizeof(int)); //CHECK: _Ptr z = malloc(sizeof(int)); *z = 1; diff --git a/clang/test/3C/b26_castprotounsafe.c b/clang/test/3C/b26_castprotounsafe.c index 623f708e1cfc..ec4726532689 100644 --- a/clang/test/3C/b26_castprotounsafe.c +++ b/clang/test/3C/b26_castprotounsafe.c @@ -55,7 +55,7 @@ char *bar() { int *sus(int *x, int *y) { //CHECK_NOALL: _Ptr sus(int *x : itype(_Ptr), _Ptr y) { - //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) { + //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) _Checked { int *z = malloc(sizeof(int)); //CHECK: _Ptr z = malloc(sizeof(int)); *z = 1; diff --git a/clang/test/3C/b26_castprotounsafeimplicit.c b/clang/test/3C/b26_castprotounsafeimplicit.c index eb10b4fefbe1..132f0a82d585 100644 --- a/clang/test/3C/b26_castprotounsafeimplicit.c +++ b/clang/test/3C/b26_castprotounsafeimplicit.c @@ -55,7 +55,7 @@ char *bar() { int *sus(int *x, int *y) { //CHECK_NOALL: _Ptr sus(int *x : itype(_Ptr), _Ptr y) { - //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) { + //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) _Checked { int *z = malloc(sizeof(int)); //CHECK: _Ptr z = malloc(sizeof(int)); *z = 1; diff --git a/clang/test/3C/b26_castprotounsafeimplicitretswitch.c b/clang/test/3C/b26_castprotounsafeimplicitretswitch.c index a77a467a92d7..685d6ee28fd7 100644 --- a/clang/test/3C/b26_castprotounsafeimplicitretswitch.c +++ b/clang/test/3C/b26_castprotounsafeimplicitretswitch.c @@ -55,7 +55,7 @@ int *bar() { char *sus(int *x, int *y) { //CHECK_NOALL: _Ptr sus(int *x : itype(_Ptr), _Ptr y) { - //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) { + //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) _Checked { char *z = malloc(sizeof(char)); //CHECK: _Ptr z = malloc(sizeof(char)); *z = 1; diff --git a/clang/test/3C/b30_structprotoconflictbodyconvert.c b/clang/test/3C/b30_structprotoconflictbodyconvert.c index 88e8ca79717b..c29ca6713bb9 100644 --- a/clang/test/3C/b30_structprotoconflictbodyconvert.c +++ b/clang/test/3C/b30_structprotoconflictbodyconvert.c @@ -80,7 +80,8 @@ struct np *bar() { } struct np *sus(struct r *x, struct r *y) { - //CHECK: _Ptr sus(_Ptr x, _Ptr y) { + //CHECK_NOALL: _Ptr sus(_Ptr x, _Ptr y) { + //CHECK_ALL: _Ptr sus(_Ptr x, _Ptr y) _Checked { x->next += 1; struct np *z = malloc(sizeof(struct np)); //CHECK: _Ptr z = malloc(sizeof(struct np)); diff --git a/clang/test/3C/b7_allsafeproto.c b/clang/test/3C/b7_allsafeproto.c index 5e3fc23315ce..d1f13e9d8cdc 100644 --- a/clang/test/3C/b7_allsafeproto.c +++ b/clang/test/3C/b7_allsafeproto.c @@ -57,7 +57,7 @@ int *bar() { int *sus(int *x, int *y) { //CHECK_NOALL: _Ptr sus(int *x : itype(_Ptr), _Ptr y) { - //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) { + //CHECK_ALL: _Ptr sus(_Array_ptr x, _Ptr y) _Checked { int *z = malloc(sizeof(int)); //CHECK: _Ptr z = malloc(sizeof(int)); *z = 1; diff --git a/clang/test/3C/b9_allsafestructp.c b/clang/test/3C/b9_allsafestructp.c index 09302e2b7750..9910c2198610 100644 --- a/clang/test/3C/b9_allsafestructp.c +++ b/clang/test/3C/b9_allsafestructp.c @@ -39,6 +39,7 @@ struct r { }; struct p sus(struct p x) { + //CHECK: struct p sus(struct p x) _Checked { struct p *n = malloc(sizeof(struct p)); //CHECK: _Ptr n = malloc(sizeof(struct p)); return *n; diff --git a/clang/test/3C/calloc.c b/clang/test/3C/calloc.c index 3a90e229818c..b3d5927765bb 100644 --- a/clang/test/3C/calloc.c +++ b/clang/test/3C/calloc.c @@ -13,7 +13,8 @@ void func(int *x : itype(_Array_ptr)); //CHECK: void func(int *x : itype(_Array_ptr)); void foo(int *w) { - //CHECK: void foo(_Ptr w) { + //CHECK_NOALL: void foo(_Ptr w) { + //CHECK_ALL: void foo(_Ptr w) _Checked { int *x = calloc(5, sizeof(int)); //CHECK_NOALL: int *x = calloc(5, sizeof(int)); //CHECK_ALL: _Array_ptr x : count(5) = calloc(5, sizeof(int)); diff --git a/clang/test/3C/fptrarrboth.c b/clang/test/3C/fptrarrboth.c index cc754b486dc1..eaf54114b728 100644 --- a/clang/test/3C/fptrarrboth.c +++ b/clang/test/3C/fptrarrboth.c @@ -137,7 +137,7 @@ int **sus(int *x, int *y) { int **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -146,8 +146,6 @@ int **foo() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); @@ -159,7 +157,7 @@ int **foo() { int **bar() { //CHECK_NOALL: int **bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -168,8 +166,6 @@ int **bar() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); diff --git a/clang/test/3C/fptrarrbothmulti1.c b/clang/test/3C/fptrarrbothmulti1.c index 3c3872d344e5..7e1b5a804179 100644 --- a/clang/test/3C/fptrarrbothmulti1.c +++ b/clang/test/3C/fptrarrbothmulti1.c @@ -124,7 +124,7 @@ int **sus(int *, int *); int **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -133,8 +133,6 @@ int **foo() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); @@ -146,7 +144,7 @@ int **foo() { int **bar() { //CHECK_NOALL: int **bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -155,8 +153,6 @@ int **bar() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); diff --git a/clang/test/3C/fptrarrcallee.c b/clang/test/3C/fptrarrcallee.c index 22f627572390..8deb7cddc129 100644 --- a/clang/test/3C/fptrarrcallee.c +++ b/clang/test/3C/fptrarrcallee.c @@ -137,7 +137,7 @@ int **sus(int *x, int *y) { int **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -146,8 +146,6 @@ int **foo() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); @@ -159,7 +157,7 @@ int **foo() { int **bar() { //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -168,8 +166,6 @@ int **bar() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); diff --git a/clang/test/3C/fptrarrcalleemulti1.c b/clang/test/3C/fptrarrcalleemulti1.c index 567f3d5ebe99..633f99c49e8a 100644 --- a/clang/test/3C/fptrarrcalleemulti1.c +++ b/clang/test/3C/fptrarrcalleemulti1.c @@ -124,7 +124,7 @@ int **sus(int *, int *); int **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -133,8 +133,6 @@ int **foo() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); @@ -146,7 +144,7 @@ int **foo() { int **bar() { //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -155,8 +153,6 @@ int **bar() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); diff --git a/clang/test/3C/fptrarrcaller.c b/clang/test/3C/fptrarrcaller.c index b97da47e9789..24794d170c0f 100644 --- a/clang/test/3C/fptrarrcaller.c +++ b/clang/test/3C/fptrarrcaller.c @@ -136,7 +136,7 @@ int **sus(int *x, int *y) { int **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -145,8 +145,6 @@ int **foo() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); @@ -158,7 +156,7 @@ int **foo() { int **bar() { //CHECK_NOALL: int **bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -167,8 +165,6 @@ int **bar() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); diff --git a/clang/test/3C/fptrarrcallermulti1.c b/clang/test/3C/fptrarrcallermulti1.c index 4dfccb09a8c8..0a52f8b4be44 100644 --- a/clang/test/3C/fptrarrcallermulti1.c +++ b/clang/test/3C/fptrarrcallermulti1.c @@ -124,7 +124,7 @@ int **sus(int *, int *); int **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -133,8 +133,6 @@ int **foo() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); @@ -146,7 +144,7 @@ int **foo() { int **bar() { //CHECK_NOALL: int **bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -155,8 +153,6 @@ int **bar() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); diff --git a/clang/test/3C/fptrarrinstructboth.c b/clang/test/3C/fptrarrinstructboth.c index 1e0e65c366dc..29be13fccdcf 100644 --- a/clang/test/3C/fptrarrinstructboth.c +++ b/clang/test/3C/fptrarrinstructboth.c @@ -134,7 +134,8 @@ struct arrfptr *sus(struct arrfptr *x, struct arrfptr *y) { } struct arrfptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -145,8 +146,6 @@ struct arrfptr *foo() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } @@ -155,7 +154,7 @@ struct arrfptr *foo() { struct arrfptr *bar() { //CHECK_NOALL: struct arrfptr *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -167,8 +166,6 @@ struct arrfptr *bar() { //CHECK_ALL: _Array_ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } diff --git a/clang/test/3C/fptrarrinstructbothmulti1.c b/clang/test/3C/fptrarrinstructbothmulti1.c index e1521b8fc90a..d3c94c9241f3 100644 --- a/clang/test/3C/fptrarrinstructbothmulti1.c +++ b/clang/test/3C/fptrarrinstructbothmulti1.c @@ -123,7 +123,8 @@ struct arrfptr *sus(struct arrfptr *, struct arrfptr *); //CHECK_ALL: struct arrfptr *sus(struct arrfptr *x : itype(_Ptr), _Ptr y) : itype(_Array_ptr); struct arrfptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -134,8 +135,6 @@ struct arrfptr *foo() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } @@ -144,7 +143,7 @@ struct arrfptr *foo() { struct arrfptr *bar() { //CHECK_NOALL: struct arrfptr *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -156,8 +155,6 @@ struct arrfptr *bar() { //CHECK_ALL: _Array_ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } diff --git a/clang/test/3C/fptrarrinstructcallee.c b/clang/test/3C/fptrarrinstructcallee.c index 6818c168bb0b..ddb0198ea325 100644 --- a/clang/test/3C/fptrarrinstructcallee.c +++ b/clang/test/3C/fptrarrinstructcallee.c @@ -133,7 +133,8 @@ struct arrfptr *sus(struct arrfptr *x, struct arrfptr *y) { } struct arrfptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -144,8 +145,6 @@ struct arrfptr *foo() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } @@ -153,7 +152,8 @@ struct arrfptr *foo() { } struct arrfptr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -164,8 +164,6 @@ struct arrfptr *bar() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } diff --git a/clang/test/3C/fptrarrinstructcalleemulti1.c b/clang/test/3C/fptrarrinstructcalleemulti1.c index 82f7ccc73127..1e8dcb9b92df 100644 --- a/clang/test/3C/fptrarrinstructcalleemulti1.c +++ b/clang/test/3C/fptrarrinstructcalleemulti1.c @@ -122,7 +122,8 @@ struct arrfptr *sus(struct arrfptr *, struct arrfptr *); //CHECK: struct arrfptr *sus(struct arrfptr *x : itype(_Ptr), _Ptr y) : itype(_Ptr); struct arrfptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -133,8 +134,6 @@ struct arrfptr *foo() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } @@ -142,7 +141,8 @@ struct arrfptr *foo() { } struct arrfptr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -153,8 +153,6 @@ struct arrfptr *bar() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } diff --git a/clang/test/3C/fptrarrinstructcaller.c b/clang/test/3C/fptrarrinstructcaller.c index 695b8ce61fd5..0306df20c0b6 100644 --- a/clang/test/3C/fptrarrinstructcaller.c +++ b/clang/test/3C/fptrarrinstructcaller.c @@ -134,7 +134,8 @@ struct arrfptr *sus(struct arrfptr *x, struct arrfptr *y) { } struct arrfptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -145,8 +146,6 @@ struct arrfptr *foo() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } @@ -155,7 +154,7 @@ struct arrfptr *foo() { struct arrfptr *bar() { //CHECK_NOALL: struct arrfptr *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -167,8 +166,6 @@ struct arrfptr *bar() { //CHECK_ALL: _Array_ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } diff --git a/clang/test/3C/fptrarrinstructcallermulti1.c b/clang/test/3C/fptrarrinstructcallermulti1.c index 51a4e6da34a0..a11da8c85efe 100644 --- a/clang/test/3C/fptrarrinstructcallermulti1.c +++ b/clang/test/3C/fptrarrinstructcallermulti1.c @@ -123,7 +123,8 @@ struct arrfptr *sus(struct arrfptr *, struct arrfptr *); //CHECK_ALL: struct arrfptr *sus(struct arrfptr *x : itype(_Ptr), _Ptr y) : itype(_Array_ptr); struct arrfptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -134,8 +135,6 @@ struct arrfptr *foo() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } @@ -144,7 +143,7 @@ struct arrfptr *foo() { struct arrfptr *bar() { //CHECK_NOALL: struct arrfptr *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -156,8 +155,6 @@ struct arrfptr *bar() { //CHECK_ALL: _Array_ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } diff --git a/clang/test/3C/fptrarrinstructprotoboth.c b/clang/test/3C/fptrarrinstructprotoboth.c index f2566073c8c1..74c3330485db 100644 --- a/clang/test/3C/fptrarrinstructprotoboth.c +++ b/clang/test/3C/fptrarrinstructprotoboth.c @@ -120,7 +120,8 @@ struct arrfptr *sus(struct arrfptr *, struct arrfptr *); //CHECK_ALL: struct arrfptr *sus(struct arrfptr *x : itype(_Ptr), _Ptr y) : itype(_Array_ptr); struct arrfptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -131,8 +132,6 @@ struct arrfptr *foo() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } @@ -141,7 +140,7 @@ struct arrfptr *foo() { struct arrfptr *bar() { //CHECK_NOALL: struct arrfptr *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -153,8 +152,6 @@ struct arrfptr *bar() { //CHECK_ALL: _Array_ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } diff --git a/clang/test/3C/fptrarrinstructprotocallee.c b/clang/test/3C/fptrarrinstructprotocallee.c index 64372a10404a..62c446017bc1 100644 --- a/clang/test/3C/fptrarrinstructprotocallee.c +++ b/clang/test/3C/fptrarrinstructprotocallee.c @@ -119,7 +119,8 @@ struct arrfptr *sus(struct arrfptr *, struct arrfptr *); //CHECK: struct arrfptr *sus(struct arrfptr *x : itype(_Ptr), _Ptr y) : itype(_Ptr); struct arrfptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -130,8 +131,6 @@ struct arrfptr *foo() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } @@ -139,7 +138,8 @@ struct arrfptr *foo() { } struct arrfptr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -150,8 +150,6 @@ struct arrfptr *bar() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } diff --git a/clang/test/3C/fptrarrinstructprotocaller.c b/clang/test/3C/fptrarrinstructprotocaller.c index ad899197e433..b497f0e3f829 100644 --- a/clang/test/3C/fptrarrinstructprotocaller.c +++ b/clang/test/3C/fptrarrinstructprotocaller.c @@ -120,7 +120,8 @@ struct arrfptr *sus(struct arrfptr *, struct arrfptr *); //CHECK_ALL: struct arrfptr *sus(struct arrfptr *x : itype(_Ptr), _Ptr y) : itype(_Array_ptr); struct arrfptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -131,8 +132,6 @@ struct arrfptr *foo() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } @@ -141,7 +140,7 @@ struct arrfptr *foo() { struct arrfptr *bar() { //CHECK_NOALL: struct arrfptr *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -153,8 +152,6 @@ struct arrfptr *bar() { //CHECK_ALL: _Array_ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } diff --git a/clang/test/3C/fptrarrinstructprotosafe.c b/clang/test/3C/fptrarrinstructprotosafe.c index 5100f664afdf..d74916e6d042 100644 --- a/clang/test/3C/fptrarrinstructprotosafe.c +++ b/clang/test/3C/fptrarrinstructprotosafe.c @@ -118,7 +118,8 @@ struct arrfptr *sus(struct arrfptr *, struct arrfptr *); //CHECK: _Ptr sus(struct arrfptr *x : itype(_Ptr), _Ptr y); struct arrfptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -129,8 +130,6 @@ struct arrfptr *foo() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } @@ -138,7 +137,8 @@ struct arrfptr *foo() { } struct arrfptr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -149,8 +149,6 @@ struct arrfptr *bar() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } diff --git a/clang/test/3C/fptrarrinstructsafe.c b/clang/test/3C/fptrarrinstructsafe.c index 008830e864ed..90b22767b3a4 100644 --- a/clang/test/3C/fptrarrinstructsafe.c +++ b/clang/test/3C/fptrarrinstructsafe.c @@ -133,7 +133,8 @@ struct arrfptr *sus(struct arrfptr *x, struct arrfptr *y) { } struct arrfptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -144,8 +145,6 @@ struct arrfptr *foo() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } @@ -153,7 +152,8 @@ struct arrfptr *foo() { } struct arrfptr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -164,8 +164,6 @@ struct arrfptr *bar() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } diff --git a/clang/test/3C/fptrarrinstructsafemulti1.c b/clang/test/3C/fptrarrinstructsafemulti1.c index d266937a469d..eb0a61709c8e 100644 --- a/clang/test/3C/fptrarrinstructsafemulti1.c +++ b/clang/test/3C/fptrarrinstructsafemulti1.c @@ -121,7 +121,8 @@ struct arrfptr *sus(struct arrfptr *, struct arrfptr *); //CHECK: _Ptr sus(struct arrfptr *x : itype(_Ptr), _Ptr y); struct arrfptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK_NOALL: _Ptr foo(void) { + //CHECK_ALL: _Ptr foo(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -132,8 +133,6 @@ struct arrfptr *foo() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } @@ -141,7 +140,8 @@ struct arrfptr *foo() { } struct arrfptr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK_NOALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct arrfptr *x = malloc(sizeof(struct arrfptr)); //CHECK: _Ptr x = malloc(sizeof(struct arrfptr)); @@ -152,8 +152,6 @@ struct arrfptr *bar() { //CHECK: _Ptr z = sus(x, y); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { z->args[i] = z->funcs[i](z->args[i]); } diff --git a/clang/test/3C/fptrarrprotoboth.c b/clang/test/3C/fptrarrprotoboth.c index 66c171ce6827..267f313bd16f 100644 --- a/clang/test/3C/fptrarrprotoboth.c +++ b/clang/test/3C/fptrarrprotoboth.c @@ -121,7 +121,7 @@ int **sus(int *, int *); int **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -130,8 +130,6 @@ int **foo() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); @@ -143,7 +141,7 @@ int **foo() { int **bar() { //CHECK_NOALL: int **bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -152,8 +150,6 @@ int **bar() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); diff --git a/clang/test/3C/fptrarrprotocallee.c b/clang/test/3C/fptrarrprotocallee.c index 4118e80bbb79..8b31e05190c7 100644 --- a/clang/test/3C/fptrarrprotocallee.c +++ b/clang/test/3C/fptrarrprotocallee.c @@ -121,7 +121,7 @@ int **sus(int *, int *); int **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -130,8 +130,6 @@ int **foo() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); @@ -143,7 +141,7 @@ int **foo() { int **bar() { //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -152,8 +150,6 @@ int **bar() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); diff --git a/clang/test/3C/fptrarrprotocaller.c b/clang/test/3C/fptrarrprotocaller.c index 0a976dc0e6da..53d126c49269 100644 --- a/clang/test/3C/fptrarrprotocaller.c +++ b/clang/test/3C/fptrarrprotocaller.c @@ -121,7 +121,7 @@ int **sus(int *, int *); int **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -130,8 +130,6 @@ int **foo() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); @@ -143,7 +141,7 @@ int **foo() { int **bar() { //CHECK_NOALL: int **bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -152,8 +150,6 @@ int **bar() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); diff --git a/clang/test/3C/fptrarrprotosafe.c b/clang/test/3C/fptrarrprotosafe.c index b1533eba39ea..07f2bb462f49 100644 --- a/clang/test/3C/fptrarrprotosafe.c +++ b/clang/test/3C/fptrarrprotosafe.c @@ -120,7 +120,7 @@ int **sus(int *, int *); int **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -129,8 +129,6 @@ int **foo() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); @@ -142,7 +140,7 @@ int **foo() { int **bar() { //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -151,8 +149,6 @@ int **bar() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); diff --git a/clang/test/3C/fptrarrsafe.c b/clang/test/3C/fptrarrsafe.c index 13cf753030b8..bc23b1e45f13 100644 --- a/clang/test/3C/fptrarrsafe.c +++ b/clang/test/3C/fptrarrsafe.c @@ -135,7 +135,7 @@ int **sus(int *x, int *y) { int **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -144,8 +144,6 @@ int **foo() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); @@ -157,7 +155,7 @@ int **foo() { int **bar() { //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -166,8 +164,6 @@ int **bar() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); diff --git a/clang/test/3C/fptrarrsafemulti1.c b/clang/test/3C/fptrarrsafemulti1.c index 79a84d17e195..2796531976a9 100644 --- a/clang/test/3C/fptrarrsafemulti1.c +++ b/clang/test/3C/fptrarrsafemulti1.c @@ -123,7 +123,7 @@ int **sus(int *, int *); int **foo() { //CHECK_NOALL: _Ptr foo(void) { - //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> foo(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -132,8 +132,6 @@ int **foo() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); @@ -145,7 +143,7 @@ int **foo() { int **bar() { //CHECK_NOALL: _Ptr bar(void) { - //CHECK_ALL: _Array_ptr<_Ptr> bar(void) : count(5) { + //CHECK_ALL: _Array_ptr<_Ptr> bar(void) : count(5) _Checked { int *x = malloc(sizeof(int)); //CHECK: _Ptr x = malloc(sizeof(int)); @@ -154,8 +152,6 @@ int **bar() { //CHECK_ALL: _Array_ptr y : count(5) = calloc(5, sizeof(int)); int i; for (i = 0; i < 5; i++) { - //CHECK_NOALL: for (i = 0; i < 5; i++) { - //CHECK_ALL: for (i = 0; i < 5; i++) _Checked { y[i] = i + 1; } int **z = sus(x, y); diff --git a/clang/test/3C/fptrinstructboth.c b/clang/test/3C/fptrinstructboth.c index 76b8af4f240e..f440633fdb01 100644 --- a/clang/test/3C/fptrinstructboth.c +++ b/clang/test/3C/fptrinstructboth.c @@ -127,7 +127,7 @@ struct fptr *sus(struct fptr *x, struct fptr *y) { } struct fptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK: _Ptr foo(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); @@ -141,7 +141,7 @@ struct fptr *foo() { struct fptr *bar() { //CHECK_NOALL: struct fptr *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); diff --git a/clang/test/3C/fptrinstructbothmulti1.c b/clang/test/3C/fptrinstructbothmulti1.c index eb00026c2ee8..5bd4923d7dc6 100644 --- a/clang/test/3C/fptrinstructbothmulti1.c +++ b/clang/test/3C/fptrinstructbothmulti1.c @@ -123,7 +123,7 @@ struct fptr *sus(struct fptr *, struct fptr *); //CHECK_ALL: struct fptr *sus(struct fptr *x : itype(_Ptr), _Ptr y) : itype(_Array_ptr); struct fptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK: _Ptr foo(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); @@ -137,7 +137,7 @@ struct fptr *foo() { struct fptr *bar() { //CHECK_NOALL: struct fptr *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); diff --git a/clang/test/3C/fptrinstructcallee.c b/clang/test/3C/fptrinstructcallee.c index 839792c14b01..7e716fd6d4e3 100644 --- a/clang/test/3C/fptrinstructcallee.c +++ b/clang/test/3C/fptrinstructcallee.c @@ -126,7 +126,7 @@ struct fptr *sus(struct fptr *x, struct fptr *y) { } struct fptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK: _Ptr foo(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); @@ -139,7 +139,7 @@ struct fptr *foo() { } struct fptr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK: _Ptr bar(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); diff --git a/clang/test/3C/fptrinstructcalleemulti1.c b/clang/test/3C/fptrinstructcalleemulti1.c index 929b787e938e..6fdc674317f0 100644 --- a/clang/test/3C/fptrinstructcalleemulti1.c +++ b/clang/test/3C/fptrinstructcalleemulti1.c @@ -122,7 +122,7 @@ struct fptr *sus(struct fptr *, struct fptr *); //CHECK: struct fptr *sus(struct fptr *x : itype(_Ptr), _Ptr y) : itype(_Ptr); struct fptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK: _Ptr foo(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); @@ -135,7 +135,7 @@ struct fptr *foo() { } struct fptr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK: _Ptr bar(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); diff --git a/clang/test/3C/fptrinstructcaller.c b/clang/test/3C/fptrinstructcaller.c index 3ad3eecf8075..5af951faca1c 100644 --- a/clang/test/3C/fptrinstructcaller.c +++ b/clang/test/3C/fptrinstructcaller.c @@ -127,7 +127,7 @@ struct fptr *sus(struct fptr *x, struct fptr *y) { } struct fptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK: _Ptr foo(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); @@ -141,7 +141,7 @@ struct fptr *foo() { struct fptr *bar() { //CHECK_NOALL: struct fptr *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); diff --git a/clang/test/3C/fptrinstructcallermulti1.c b/clang/test/3C/fptrinstructcallermulti1.c index a30679cf78fe..04fbd9c158df 100644 --- a/clang/test/3C/fptrinstructcallermulti1.c +++ b/clang/test/3C/fptrinstructcallermulti1.c @@ -123,7 +123,7 @@ struct fptr *sus(struct fptr *, struct fptr *); //CHECK_ALL: struct fptr *sus(struct fptr *x : itype(_Ptr), _Ptr y) : itype(_Array_ptr); struct fptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK: _Ptr foo(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); @@ -137,7 +137,7 @@ struct fptr *foo() { struct fptr *bar() { //CHECK_NOALL: struct fptr *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); diff --git a/clang/test/3C/fptrinstructprotoboth.c b/clang/test/3C/fptrinstructprotoboth.c index eb7261972aab..1b401fa8a9ec 100644 --- a/clang/test/3C/fptrinstructprotoboth.c +++ b/clang/test/3C/fptrinstructprotoboth.c @@ -120,7 +120,7 @@ struct fptr *sus(struct fptr *, struct fptr *); //CHECK_ALL: struct fptr *sus(struct fptr *x : itype(_Ptr), _Ptr y) : itype(_Array_ptr); struct fptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK: _Ptr foo(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); @@ -134,7 +134,7 @@ struct fptr *foo() { struct fptr *bar() { //CHECK_NOALL: struct fptr *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); diff --git a/clang/test/3C/fptrinstructprotocallee.c b/clang/test/3C/fptrinstructprotocallee.c index f98d03ab558c..352da68af652 100644 --- a/clang/test/3C/fptrinstructprotocallee.c +++ b/clang/test/3C/fptrinstructprotocallee.c @@ -119,7 +119,7 @@ struct fptr *sus(struct fptr *, struct fptr *); //CHECK: struct fptr *sus(struct fptr *x : itype(_Ptr), _Ptr y) : itype(_Ptr); struct fptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK: _Ptr foo(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); @@ -132,7 +132,7 @@ struct fptr *foo() { } struct fptr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK: _Ptr bar(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); diff --git a/clang/test/3C/fptrinstructprotocaller.c b/clang/test/3C/fptrinstructprotocaller.c index 6fa7fef96357..9a248acbfae2 100644 --- a/clang/test/3C/fptrinstructprotocaller.c +++ b/clang/test/3C/fptrinstructprotocaller.c @@ -120,7 +120,7 @@ struct fptr *sus(struct fptr *, struct fptr *); //CHECK_ALL: struct fptr *sus(struct fptr *x : itype(_Ptr), _Ptr y) : itype(_Array_ptr); struct fptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK: _Ptr foo(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); @@ -134,7 +134,7 @@ struct fptr *foo() { struct fptr *bar() { //CHECK_NOALL: struct fptr *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Ptr bar(void) { + //CHECK_ALL: _Ptr bar(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); diff --git a/clang/test/3C/fptrinstructprotosafe.c b/clang/test/3C/fptrinstructprotosafe.c index 2c0bfac240b9..6362cca27306 100644 --- a/clang/test/3C/fptrinstructprotosafe.c +++ b/clang/test/3C/fptrinstructprotosafe.c @@ -118,7 +118,7 @@ struct fptr *sus(struct fptr *, struct fptr *); //CHECK: _Ptr sus(struct fptr *x : itype(_Ptr), _Ptr y); struct fptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK: _Ptr foo(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); @@ -131,7 +131,7 @@ struct fptr *foo() { } struct fptr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK: _Ptr bar(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); diff --git a/clang/test/3C/fptrinstructsafe.c b/clang/test/3C/fptrinstructsafe.c index db29ced2b489..8c9d7da0b26d 100644 --- a/clang/test/3C/fptrinstructsafe.c +++ b/clang/test/3C/fptrinstructsafe.c @@ -124,7 +124,7 @@ struct fptr *sus(struct fptr *x, struct fptr *y) { } struct fptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK: _Ptr foo(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); @@ -137,7 +137,7 @@ struct fptr *foo() { } struct fptr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK: _Ptr bar(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); diff --git a/clang/test/3C/fptrinstructsafemulti1.c b/clang/test/3C/fptrinstructsafemulti1.c index 0effbcb3cba8..b66f20b97513 100644 --- a/clang/test/3C/fptrinstructsafemulti1.c +++ b/clang/test/3C/fptrinstructsafemulti1.c @@ -121,7 +121,7 @@ struct fptr *sus(struct fptr *, struct fptr *); //CHECK: _Ptr sus(struct fptr *x : itype(_Ptr), _Ptr y); struct fptr *foo() { - //CHECK: _Ptr foo(void) { + //CHECK: _Ptr foo(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); @@ -134,7 +134,7 @@ struct fptr *foo() { } struct fptr *bar() { - //CHECK: _Ptr bar(void) { + //CHECK: _Ptr bar(void) _Checked { struct fptr *x = malloc(sizeof(struct fptr)); //CHECK: _Ptr x = malloc(sizeof(struct fptr)); diff --git a/clang/test/3C/fptrsafeboth.c b/clang/test/3C/fptrsafeboth.c index 50172762350b..572d10244b3f 100644 --- a/clang/test/3C/fptrsafeboth.c +++ b/clang/test/3C/fptrsafeboth.c @@ -145,6 +145,7 @@ int *foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -171,6 +172,7 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/fptrsafebothmulti1.c b/clang/test/3C/fptrsafebothmulti1.c index f14958c5e57e..667b9f6b36a0 100644 --- a/clang/test/3C/fptrsafebothmulti1.c +++ b/clang/test/3C/fptrsafebothmulti1.c @@ -134,6 +134,7 @@ int *foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -160,6 +161,7 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/fptrsafecallee.c b/clang/test/3C/fptrsafecallee.c index 57d63728e6c5..31f174b3376d 100644 --- a/clang/test/3C/fptrsafecallee.c +++ b/clang/test/3C/fptrsafecallee.c @@ -145,6 +145,7 @@ int *foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -171,6 +172,7 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/fptrsafecalleemulti1.c b/clang/test/3C/fptrsafecalleemulti1.c index cc4d82d751f3..9706af9d38cd 100644 --- a/clang/test/3C/fptrsafecalleemulti1.c +++ b/clang/test/3C/fptrsafecalleemulti1.c @@ -134,6 +134,7 @@ int *foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -160,6 +161,7 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/fptrsafecaller.c b/clang/test/3C/fptrsafecaller.c index ba681e2980f1..f1fd69c87c4f 100644 --- a/clang/test/3C/fptrsafecaller.c +++ b/clang/test/3C/fptrsafecaller.c @@ -144,6 +144,7 @@ int *foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -170,6 +171,7 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/fptrsafecallermulti1.c b/clang/test/3C/fptrsafecallermulti1.c index 4bf1d5a7f0ff..8d1968b1205e 100644 --- a/clang/test/3C/fptrsafecallermulti1.c +++ b/clang/test/3C/fptrsafecallermulti1.c @@ -134,6 +134,7 @@ int *foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -160,6 +161,7 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/fptrsafeprotoboth.c b/clang/test/3C/fptrsafeprotoboth.c index 223290c6c7ce..316db427b501 100644 --- a/clang/test/3C/fptrsafeprotoboth.c +++ b/clang/test/3C/fptrsafeprotoboth.c @@ -131,6 +131,7 @@ int *foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -157,6 +158,7 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/fptrsafeprotocallee.c b/clang/test/3C/fptrsafeprotocallee.c index 2d7ec938bad9..8a2f006a44be 100644 --- a/clang/test/3C/fptrsafeprotocallee.c +++ b/clang/test/3C/fptrsafeprotocallee.c @@ -131,6 +131,7 @@ int *foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -157,6 +158,7 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/fptrsafeprotocaller.c b/clang/test/3C/fptrsafeprotocaller.c index 030622e42906..b1f3c2fa7548 100644 --- a/clang/test/3C/fptrsafeprotocaller.c +++ b/clang/test/3C/fptrsafeprotocaller.c @@ -131,6 +131,7 @@ int *foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -157,6 +158,7 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/fptrsafeprotosafe.c b/clang/test/3C/fptrsafeprotosafe.c index 39791d78956d..1391b498b525 100644 --- a/clang/test/3C/fptrsafeprotosafe.c +++ b/clang/test/3C/fptrsafeprotosafe.c @@ -130,6 +130,7 @@ int *foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -156,6 +157,7 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/fptrsafesafe.c b/clang/test/3C/fptrsafesafe.c index 95d65cfc4ac9..f2968d0d5a55 100644 --- a/clang/test/3C/fptrsafesafe.c +++ b/clang/test/3C/fptrsafesafe.c @@ -143,6 +143,7 @@ int *foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -169,6 +170,7 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/fptrsafesafemulti1.c b/clang/test/3C/fptrsafesafemulti1.c index 6d07f79ebc15..bf156b31f485 100644 --- a/clang/test/3C/fptrsafesafemulti1.c +++ b/clang/test/3C/fptrsafesafemulti1.c @@ -133,6 +133,7 @@ int *foo() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; @@ -159,6 +160,7 @@ int *bar() { //CHECK: _Ptr curr = y; int i; for (i = 1; i < 5; i++, curr = curr->next) { + //CHECK: for (i = 1; i < 5; i++, curr = curr->next) _Checked { curr->data = i; curr->next = malloc(sizeof(struct general)); curr->next->data = i + 1; diff --git a/clang/test/3C/free.c b/clang/test/3C/free.c index 92e44002f936..05da89159f60 100644 --- a/clang/test/3C/free.c +++ b/clang/test/3C/free.c @@ -9,7 +9,7 @@ _Itype_for_any(T) void *malloc(size_t size) int *test() { // CHECK_NOALL: int *test(void) : itype(_Ptr) { - // CHECK_ALL: _Array_ptr test(void) : count(5) { + // CHECK_ALL: _Array_ptr test(void) : count(5) _Checked { int *a = malloc(sizeof(int)); // CHECK: _Ptr a = malloc(sizeof(int)); free(a); @@ -28,7 +28,7 @@ _Itype_for_any(T) void my_free(void *pointer int *test2() { // CHECK_NOALL: int *test2(void) : itype(_Ptr) { - // CHECK_ALL: _Array_ptr test2(void) : count(5) { + // CHECK_ALL: _Array_ptr test2(void) : count(5) _Checked { int *a = malloc(sizeof(int)); // CHECK: _Ptr a = malloc(sizeof(int)); my_free(a); diff --git a/clang/test/3C/funcptr1.c b/clang/test/3C/funcptr1.c index a7ae2d53985f..1f9ba7c23e00 100644 --- a/clang/test/3C/funcptr1.c +++ b/clang/test/3C/funcptr1.c @@ -22,6 +22,5 @@ int *g(int *x) { return 0; } void h() { - //CHECK: void h() _Checked { f(g); } diff --git a/clang/test/3C/funcptr2.c b/clang/test/3C/funcptr2.c index e2d62e8058af..dc20ed91a6b1 100644 --- a/clang/test/3C/funcptr2.c +++ b/clang/test/3C/funcptr2.c @@ -25,7 +25,6 @@ int *g(int *x) { return 0; } void h() { - //CHECK: void h() _Checked { f(g); f(g2); } diff --git a/clang/test/3C/graphs.c b/clang/test/3C/graphs.c index 83d7c8bd2a2c..3945530cda01 100644 --- a/clang/test/3C/graphs.c +++ b/clang/test/3C/graphs.c @@ -274,6 +274,8 @@ struct Graph *createGraph(int vertices) //CHECK: _Ptr createGraph(int vertices) { + //CHECK_NOALL: { + //CHECK_ALL: _Checked { struct Graph *graph = malloc(sizeof(struct Graph)); //CHECK: _Ptr graph = malloc(sizeof(struct Graph)); @@ -290,6 +292,8 @@ struct Graph *createGraph(int vertices) int i; for (i = 0; i < vertices; i++) { + //CHECK_NOALL: for (i = 0; i < vertices; i++) { + //CHECK_ALL: for (i = 0; i < vertices; i++) _Unchecked { graph->adjLists[i] = NULL; @@ -365,6 +369,8 @@ struct Stack *createStack() //CHECK: _Ptr createStack(void) { + //CHECK_NOALL: { + //CHECK_ALL: _Checked { struct Stack *stack = malloc(sizeof(struct Stack)); //CHECK: _Ptr stack = malloc(sizeof(struct Stack)); diff --git a/clang/test/3C/graphs2.c b/clang/test/3C/graphs2.c index b3245d17fd1c..8e898b4472e9 100644 --- a/clang/test/3C/graphs2.c +++ b/clang/test/3C/graphs2.c @@ -31,7 +31,8 @@ struct Graph { /*Constructs a graph with V vertices and E edges*/ void createGraph(struct Graph *G, int V) { - //CHECK: void createGraph(_Ptr G, int V) { + //CHECK_NOALL: void createGraph(_Ptr G, int V) { + //CHECK_ALL: void createGraph(_Ptr G, int V) _Checked { G->vertexNum = V; diff --git a/clang/test/3C/inline_anon_structs.c b/clang/test/3C/inline_anon_structs.c index 33f00f0f1a07..c778fd1c828a 100644 --- a/clang/test/3C/inline_anon_structs.c +++ b/clang/test/3C/inline_anon_structs.c @@ -81,7 +81,8 @@ struct { /*ensure trivial conversion*/ void foo1(int *w) { - //CHECK: void foo1(_Ptr w) { + //CHECK_NOALL: void foo1(_Ptr w) { + //CHECK_ALL: void foo1(_Ptr w) _Checked { x->data = malloc(sizeof(int) * 4); x->data[1] = 4; } diff --git a/clang/test/3C/invalidbounds.c b/clang/test/3C/invalidbounds.c index aba9ad29fb23..129e1f460b72 100644 --- a/clang/test/3C/invalidbounds.c +++ b/clang/test/3C/invalidbounds.c @@ -1,6 +1,6 @@ // RUN: 3c -base-dir=%S -alltypes -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s -// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s -// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null - +// : 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s +// : 3c -base-dir=%S -addcr %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null - /* Regression test for the issue: @@ -15,6 +15,8 @@ extern _Itype_for_any(T) void *malloc(size_t size) unsigned long strlen(const char *s : itype(_Nt_array_ptr)); int foo() { +//CHECK_ALL: int foo() _Checked { +//CHECK_NOALL: int foo() { const char *invalstr = "%b %d %H:%M"; const char *valstr = "%b %d %H"; //CHECK_ALL: _Nt_array_ptr invalstr = "%b %d %H:%M"; @@ -27,12 +29,8 @@ int foo() { //CHECK_ALL: _Array_ptr arr1inval = malloc(n * sizeof(char)); //CHECK_NOALL: char *arr1inval = malloc(n * sizeof(char)); if (n > 0) { - //CHECK_ALL: if (n > 0) _Checked { - //CHECK_NOALL: if (n > 0) { invalstr = "%b %d %H"; } else { - //CHECK_ALL: } else _Checked { - //CHECK_NOALL: } else { valstr = "%b %d %M"; } strlen(invalstr); diff --git a/clang/test/3C/linkedlist.c b/clang/test/3C/linkedlist.c index 567c9d4e7bb5..f6bbea16ab2a 100644 --- a/clang/test/3C/linkedlist.c +++ b/clang/test/3C/linkedlist.c @@ -39,6 +39,7 @@ struct node { struct list { Node *head; + //CHECK: _Ptr head; }; Node *createnode(int data); @@ -48,7 +49,7 @@ Node *createnode(int data) { //CHECK: _Ptr createnode(int data) { Node *newNode = malloc(sizeof(Node)); - //CHECK: _Ptr newNode = malloc(sizeof(Node)); + //CHECK: _Ptr newNode = malloc(sizeof(Node)); if (!newNode) { @@ -82,6 +83,7 @@ void display(List *list) { //CHECK: void display(_Ptr list) { Node *current = list->head; + //CHECK: _Ptr current = list->head; if (list->head == NULL) @@ -97,8 +99,10 @@ void add(int data, List *list) { //CHECK: void add(int data, _Ptr list) { Node *current = NULL; + //CHECK: _Ptr current = NULL; if (list->head == NULL) { + //CHECK: if (list->head == NULL) _Checked { list->head = createnode(data); @@ -109,6 +113,7 @@ void add(int data, List *list) { current = list->head; while (current->next != NULL) { + //CHECK: while (current->next != NULL) _Checked { current = current->next; } @@ -121,10 +126,13 @@ void delete (int data, List *list) { //CHECK: void delete (int data, _Ptr list) { Node *current = list->head; + //CHECK: _Ptr current = list->head; Node *previous = current; + //CHECK: _Ptr previous = current; while (current != NULL) { + //CHECK: while (current != NULL) _Checked { if (current->data == data) { @@ -149,12 +157,16 @@ void reverse(List *list) { //CHECK: void reverse(_Ptr list) { Node *reversed = NULL; + //CHECK: _Ptr reversed = NULL; Node *current = list->head; + //CHECK: _Ptr current = list->head; Node *temp = NULL; + //CHECK: _Ptr temp = NULL; while (current != NULL) { + //CHECK: while (current != NULL) _Checked { temp = current; @@ -169,13 +181,16 @@ void reverse(List *list) { } void destroy(List *list) { - //CHECK: void destroy(_Ptr list) { + //CHECK: void destroy(_Ptr list) { Node *current = list->head; + //CHECK: _Ptr current = list->head; Node *next = current; + //CHECK: _Ptr next = current; while (current != NULL) { + //CHECK: while (current != NULL) _Checked { next = current->next; free(current); current = next; diff --git a/clang/test/3C/pointerarithm.c b/clang/test/3C/pointerarithm.c index 1faa9f13094b..0433db74c04e 100644 --- a/clang/test/3C/pointerarithm.c +++ b/clang/test/3C/pointerarithm.c @@ -27,7 +27,7 @@ int *sus(int *x, int *y) { *x = 2; return z; } -//CHECK: _Array_ptr sus(_Array_ptr x, _Ptr y) : count(2) { +//CHECK: _Array_ptr sus(_Array_ptr x, _Ptr y) : count(2) _Checked { //CHECK-NEXT: _Array_ptr z : count(2) = malloc(sizeof(int) * 2); int *foo() { diff --git a/clang/test/3C/realloc.c b/clang/test/3C/realloc.c index d0ec3c41ade9..2b992fb9e231 100644 --- a/clang/test/3C/realloc.c +++ b/clang/test/3C/realloc.c @@ -14,7 +14,8 @@ extern _Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr) byte_count(size); void foo(int *w) { - //CHECK: void foo(_Ptr w) { + //CHECK_NOALL: void foo(_Ptr w) { + //CHECK_ALL: void foo(_Ptr w) _Checked { int *y = malloc(2 * sizeof(int)); //CHECK_NOALL: int *y = malloc(2 * sizeof(int)); //CHECK_ALL: _Array_ptr y : count(2) = malloc(2 * sizeof(int)); diff --git a/clang/test/3C/return_not_least.c b/clang/test/3C/return_not_least.c index f0a3c871c343..d9157dea0856 100644 --- a/clang/test/3C/return_not_least.c +++ b/clang/test/3C/return_not_least.c @@ -46,7 +46,7 @@ extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) int *bar() { //CHECK_NOALL: int *bar(void) : itype(_Ptr) { - //CHECK_ALL: _Array_ptr bar(void) { + //CHECK_ALL: _Array_ptr bar(void) _Checked { int *z = calloc(2, sizeof(int)); //CHECK_NOALL: int *z = calloc(2, sizeof(int)); //CHECK_ALL: _Array_ptr z = calloc(2, sizeof(int)); diff --git a/clang/test/3C/single_ptr_calloc.c b/clang/test/3C/single_ptr_calloc.c index 04018b0de7ff..b1b1cc940474 100644 --- a/clang/test/3C/single_ptr_calloc.c +++ b/clang/test/3C/single_ptr_calloc.c @@ -10,7 +10,8 @@ extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr) byte_count(nmemb * size); void foo(int *w) { - //CHECK: void foo(_Ptr w) { + //CHECK_NOALL: void foo(_Ptr w) { + //CHECK_ALL: void foo(_Ptr w) _Checked { /*only allocating 1 thing, so should be converted even without alltypes*/ int *x = calloc(1, sizeof(int)); //CHECK: _Ptr x = calloc(1, sizeof(int)); diff --git a/clang/test/3C/type_params.c b/clang/test/3C/type_params.c index 6c760f763ab4..048dbd5a1126 100644 --- a/clang/test/3C/type_params.c +++ b/clang/test/3C/type_params.c @@ -1,7 +1,7 @@ // RUN: rm -rf %t* // RUN: 3c -base-dir=%S -addcr -alltypes %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s -// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s -// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -fcheckedc-extension -x c -o %t1.unused - +// : 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s +// : 3c -base-dir=%S -addcr %s -- | %clang -c -fcheckedc-extension -x c -o %t1.unused - // General demonstration _Itype_for_any(T) void *test_single(void *a @@ -10,7 +10,7 @@ _Itype_for_any(T) void *test_single(void *a : itype(_Ptr); void t0(int *a, int *b) { - //CHECK: void t0(_Ptr a, _Ptr b) { + //CHECK: void t0(_Ptr a, _Ptr b) _Checked { test_single(a, b); //CHECK: test_single(a, b); } @@ -23,7 +23,7 @@ void t1(int *a, int *b) { } void t10(int **a, int **b) { - //CHECK: void t10(_Ptr<_Ptr> a, _Ptr<_Ptr> b) { + //CHECK: void t10(_Ptr<_Ptr> a, _Ptr<_Ptr> b) _Checked { test_single(a, b); //CHECK: test_single<_Ptr>(a, b); } @@ -36,7 +36,7 @@ _Itype_for_any(T, U) void *test_double(void *a : itype(_Ptr); void t2(int *a, int *b, float *c, float *d) { - //CHECK: void t2(_Ptr a, _Ptr b, _Ptr c, _Ptr d) { + //CHECK: void t2(_Ptr a, _Ptr b, _Ptr c, _Ptr d) _Checked { test_double(a, b, c, d); //CHECK: test_double(a, b, c, d); } @@ -111,6 +111,7 @@ void foo(int *p2) { // Array types can be used to instantiate type params void arrs() { +// CHECK_ALL: void arrs() _Checked { int *p = malloc(10 * sizeof(int)); // CHECK_ALL: _Array_ptr p : count(10) = malloc(10 * sizeof(int)); int q[10]; @@ -130,7 +131,7 @@ void f0() { } void f1(int **a, float **b) { - // CHECK: void f1(_Ptr<_Ptr> a, _Ptr<_Ptr> b) { + // CHECK: void f1(_Ptr<_Ptr> a, _Ptr<_Ptr> b) _Checked { int **c = test1(a); float **d = test1(b); // CHECK: _Ptr<_Ptr> c = test1<_Ptr>(a);