aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorAndrei Alexeyev <akari@taisei-project.org>2020-04-02 03:43:24 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2020-04-04 20:51:35 +0300
commit96ed64caa11f977c33ae8bf4143f8756ab3c1a36 (patch)
tree6e93a64eae35e86a72c3e395bbc1dc27c037e0ae /test cases
parent1a741e0439deeef241053df04bc6e521d70aaae5 (diff)
downloadmeson-96ed64caa11f977c33ae8bf4143f8756ab3c1a36.zip
meson-96ed64caa11f977c33ae8bf4143f8756ab3c1a36.tar.gz
meson-96ed64caa11f977c33ae8bf4143f8756ab3c1a36.tar.bz2
Make cc.has_function work on GCC/Clang __builtins
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/39 has function/meson.build8
1 files changed, 8 insertions, 0 deletions
diff --git a/test cases/common/39 has function/meson.build b/test cases/common/39 has function/meson.build
index 539f313..16f43c4 100644
--- a/test cases/common/39 has function/meson.build
+++ b/test cases/common/39 has function/meson.build
@@ -88,4 +88,12 @@ foreach cc : compilers
assert (cc.has_function('sendmmsg', args : unit_test_args),
'Failed to detect function "sendmmsg" (should always exist).')
endif
+
+ # We should be able to find GCC and Clang __builtin functions
+ if ['gcc', 'clang'].contains(cc.get_id())
+ # __builtin_constant_p is documented to exist at least as far back as
+ # GCC 2.95.3
+ assert(cc.has_function('__builtin_constant_p', args : unit_test_args),
+ '__builtin_constant_p must be found under gcc and clang')
+ endif
endforeach