summaryrefslogtreecommitdiff
path: root/clang/unittests/AST
diff options
context:
space:
mode:
authorIlya Karapsin <ilya84050@gmail.com>2023-03-17 09:50:34 -0400
committerAaron Ballman <aaron@aaronballman.com>2023-03-17 09:52:41 -0400
commit2147e940e8a8f85f97f28407989c628886b5cd7e (patch)
treea9bbdc8ced1eee8d22b0c9872c38a241dfafa48d /clang/unittests/AST
parent5ecba1543477e5448ec3566aec7b3756f98a3fb6 (diff)
downloadllvm-2147e940e8a8f85f97f28407989c628886b5cd7e.tar.gz
Add __builtin_FILE_NAME()
Add '__builtin_FILE_NAME()', which expands to the filename because the full path is not always needed. It corresponds to the '__FILE_NAME__' predefined macro and is consistent with the other '__builin' functions added for predefined macros. Differential Revision: https://reviews.llvm.org/D144878
Diffstat (limited to 'clang/unittests/AST')
-rw-r--r--clang/unittests/AST/ASTImporterTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/AST/ASTImporterTest.cpp b/clang/unittests/AST/ASTImporterTest.cpp
index fecfac4c5914..6300551ca446 100644
--- a/clang/unittests/AST/ASTImporterTest.cpp
+++ b/clang/unittests/AST/ASTImporterTest.cpp
@@ -259,6 +259,10 @@ TEST_P(ImportExpr, ImportSourceLocExpr) {
Lang_CXX03, Verifier,
functionDecl(hasDescendant(
sourceLocExpr(hasBuiltinStr("__builtin_FILE")))));
+ testImport("void declToImport() { (void)__builtin_FILE_NAME(); }", Lang_CXX03,
+ "", Lang_CXX03, Verifier,
+ functionDecl(hasDescendant(
+ sourceLocExpr(hasBuiltinStr("__builtin_FILE_NAME")))));
testImport("void declToImport() { (void)__builtin_COLUMN(); }", Lang_CXX03,
"", Lang_CXX03, Verifier,
functionDecl(hasDescendant(