Skip to content

Conversation

arunkumarbhattar
Copy link
Member

@arunkumarbhattar arunkumarbhattar commented Jan 14, 2023

Title: Add Test Suite for Backward Compatibility Syntax and Macros

Description: This PR adds a comprehensive test suite to verify the correct implementation of the alternate syntax and macros introduced for enhancing backward compatibility of Checked C code with non-Checked C compilers, as proposed in this wiki page. The test suite covers the following key aspects:

Pointer types: Test cases to validate the proper functioning of _Array, _Nt_array, and _Single qualifiers for pointer types.
Arrays: Verify that the _Checked keyword behaves as expected when a compiler does not support Checked C.
Generic types: Validate the correct functioning of the _TyArg and _TyVar macros, as well as the two-part approach for generic function definitions and generic struct definitions.
Bounds annotations: Validate the new keywords _Any, _Bounds, _Byte_count, and _Count for bounds expressions, and test cases for declarators followed by bounds expressions.
Dynamic check expressions: Test cases to ensure the correct evaluation of dynamic check expressions and their compatibility with the assert macro.
Bounds cast expressions: Validate the functioning of variadic macros for _Dynamic_bounds_cast and _Assume_bounds_cast expressions, and their correct mapping to syntax forms or C-style casts.
Where clauses: Test cases for where clauses with optional parentheses, and the proper discarding of the where clause body when Checked C is not supported.
The test suite ensures that the alternate syntax and macros introduced for backward compatibility function correctly and maintain the safety guarantees of Checked C code, improving code portability and platform compatibility.
REGRESSION SANITY*************
Clang Regression sanity tests (TARGET: check-clang):

Testing Time: 2216.67s
Unsupported : 74
Passed : 27667
Expectedly Failed: 34

CheckedC regression sanity test (TARGET: check-checkedc)
checkedc :: checkedc/tests/typechecking/pointer_types.c
Testing Time: 17.55s
Unsupported: 3
Passed : 96

Testing Time: 3170.01s
Unsupported : 734
Passed : 69511
Expectedly Failed: 193
Failed : 12

Untouched version was failing 10 test cases.
Checking the RC behind the two extra failed TCs. Mostly could be a VM issue.
REGRESSION SANITY*************


// type-qualifiers
unsigned TypeQualifiers : 5; // Bitwise OR of TQ.
unsigned TypeQualifiers : 8; // Bitwise OR of TQ.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explanation:
TypeQualifiers are defined under DeclSpec (First phase of parsing qualifiers) and QualType (2nd phase)
I have expanded TQ under DeclSpec but NOT under QualType as doing the second was rabbit hole and required major changes, due to its interweaving with 3-Bit FastMask (expanding this in size is extremely complex)

@dtarditi
Copy link
Member

@arunkumarbhattar Is this subsumed.by PR #1199? It looks it is. If so, we should close this PR.

dtarditi pushed a commit that referenced this pull request Sep 28, 2024
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](isaacs/minimatch@v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants