Skip to content

Add AST Serialization/Deserialization Tests #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
secure-sw-dev-bot opened this issue Jan 16, 2022 · 1 comment
Closed

Add AST Serialization/Deserialization Tests #102

secure-sw-dev-bot opened this issue Jan 16, 2022 · 1 comment

Comments

@secure-sw-dev-bot
Copy link

This issue was copied from checkedc/checkedc-clang#102


This is making sure that we don't break pre-compiled headers at any point.

Not only do we include new PCH tests, but in order to get them to pass, I had to fix the following bugs:

  • One of the initializers of PositionalParameterExpr (specifically the Empty one) had a copy/paste bug, which meant it was initializing the wrong kind of expression.
  • We were not writing the sub-expressions within bounds expressions correctly. Now they are written in the same way that the visitor writes other sub-expressions of other expression types.
  • We were not saving the "type as written" information for the InteropTypeBoundsAnnotationExpr, which meant that we couldn't deserialize it. It is now saved and re-read correctly.

The test compiles a header and source file together, then tests compiling the header separately into a PCH, and then compiling the source file using the PCH. They should have the same set of errors. We use -verify and diagnostic annotations as tests. Currently we ignore diagnostic notes, as there seems to be an issue with putting expectations in the header to be compiled into the PCH.

Currently most of the tests are testing that everything works, rather than testing that certain things fail. This could be improved later.

This should help us with #3.

@secure-sw-dev-bot
Copy link
Author

Comment from @msftclas:

Hi @lenary, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Samuel Hemsley Elliott). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

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

No branches or pull requests

1 participant