summaryrefslogtreecommitdiff
path: root/test/Preprocessor
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2019-05-29 03:15:36 +0000
committerEric Fiselier <eric@efcs.ca>2019-05-29 03:15:36 +0000
commit86873839af7530176e3a062ecbf7edf74048922c (patch)
treee4fc7bc381fc6670c5819104d6db1a9ef7868a17 /test/Preprocessor
parent5240ba5698fc167c5f124994ec80eb1a896528fd (diff)
downloadclang-86873839af7530176e3a062ecbf7edf74048922c.tar.gz
Make __has_builtin work with __builtin_LINE and friends.
The source location builtins are implemented as keywords, but __has_builtin should still report true for them. This patch also fixes a test failure on systemz where the alignment of string literals is 2 not 1. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Preprocessor')
-rw-r--r--test/Preprocessor/feature_tests.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Preprocessor/feature_tests.c b/test/Preprocessor/feature_tests.c
index c2fbd11c97..2035a729f2 100644
--- a/test/Preprocessor/feature_tests.c
+++ b/test/Preprocessor/feature_tests.c
@@ -20,6 +20,15 @@
#error Clang should have these
#endif
+// These are technically implemented as keywords, but __has_builtin should
+// still return true.
+#if !__has_builtin(__builtin_LINE) || \
+ !__has_builtin(__builtin_FILE) || \
+ !__has_builtin(__builtin_FUNCTION) || \
+ !__has_builtin(__builtin_COLUMN)
+#error Clang should have these
+#endif
+
#if __has_builtin(__builtin_insanity)
#error Clang should not have this
#endif