summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2019-11-06 22:40:18 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2019-11-06 22:44:34 +0000
commit8f02136721af40dd89a09101504750fb28f8142e (patch)
tree70ec92a33b182635104f88969175f0d27a784bd1
parenttoolchain-funcs.eclass: fix tc-cpp-is-true() to work with clang (diff)
downloadgentoo-8f02136721af40dd89a09101504750fb28f8142e.tar.gz
gentoo-8f02136721af40dd89a09101504750fb28f8142e.tar.bz2
gentoo-8f02136721af40dd89a09101504750fb28f8142e.zip
eclass/tests/toolchain-funcs.sh add test for 'tc-cpp-is-true()'
With patch from bug #698912 reverted we observe failures as: * Testing tc-cpp-is-true (gcc, defined) ... [ ok ] * Testing tc-cpp-is-true (gcc, not defined) ... [ ok ] * Testing tc-cpp-is-true (gcc, defined on -ggdb3) ... [ !! ] * Testing tc-cpp-is-true (clang, defined) ... [ !! ] * Testing tc-cpp-is-true (clang, not defined) ... [ ok ] * Testing tc-cpp-is-true (clang, defined on -ggdb3) ... [ !! ] Closes: https://bugs.gentoo.org/698912 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rwxr-xr-xeclass/tests/toolchain-funcs.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh
index bcf57f78201a..79ba6fa407b5 100755
--- a/eclass/tests/toolchain-funcs.sh
+++ b/eclass/tests/toolchain-funcs.sh
@@ -172,4 +172,28 @@ if type -P pathcc &>/dev/null; then
tend $?
fi
+for compiler in gcc clang; do
+ if type -P ${compielr} &>/dev/null; then
+ tbegin "tc-cpp-is-true ($compiler, defined)"
+ (
+ export CC=${compiler}
+ tc-cpp-is-true "defined(SOME_DEFINED_SYMBOL)" -DSOME_DEFINED_SYMBOL
+ )
+ tend $?
+ tbegin "tc-cpp-is-true ($compiler, not defined)"
+ (
+ export CC=${compiler}
+ ! tc-cpp-is-true "defined(SOME_UNDEFINED_SYMBOL)"
+ )
+ tend $?
+
+ tbegin "tc-cpp-is-true ($compiler, defined on -ggdb3)"
+ (
+ export CC=${compiler}
+ tc-cpp-is-true "defined(SOME_DEFINED_SYMBOL)" -DSOME_DEFINED_SYMBOL -ggdb3
+ )
+ tend $?
+ fi
+done
+
texit