================
@@ -552,6 +552,19 @@ file './input.cpp'
   }
 }
 
+TEST_F(TokenCollectorTest, FeatureLikeBuiltinMacros) {
----------------
hongtaihu wrote:



> Is this test actually validating the source location information?
> 
> I was trying to think of a way to validate this via lit testing and I don't 
> think this can be observed, but maybe we can get sufficiently creative with 
> testing the location a diagnostic appears at?

Thanks, good point. I updated the test to check the source location metadata 
directly.

  It now checks the expansion range of the synthesized `1` token with
  `SourceManager::getExpansionRange()`, and verifies that the range starts at
  `__has_builtin` and ends at the closing paren of the builtin macro invocation.



https://github.com/llvm/llvm-project/pull/207130
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to