]> git.saurik.com Git - bison.git/blobdiff - tests/headers.at
tests: check that C and C++ objects can be linked together.
[bison.git] / tests / headers.at
index 8e70a7eb4f347cd556dbfcd1b4996e90eec4d373..a60e3153d7f198dd893c5884faa4a0ee620b52f7 100644 (file)
@@ -240,9 +240,6 @@ AT_TEST([x7], [%define api.push-pull both])
 AT_TEST([x8], [%define api.pure %define api.push-pull both])
 #AT_TEST([x5], [%locations %language "c++" %glr-parser])
 
-AT_COMPILE_CXX([parser], [[x[1-8].o -DCC_IS_CXX=$CC_IS_CXX main.cc]])
-AT_CHECK([./parser], [0], [[expout]])
-
 # Check that the headers are self-contained, and protected against
 # multiple inclusions.  While at it, check they are sane for C++.
 for h in *.h *.hh
@@ -256,6 +253,12 @@ EOF
   AT_COMPILE_CXX([$h.o])
 done
 
+# Do this late, so that other checks have been performed.
+AT_SKIP_IF_CANNOT_LINK_C_AND_CXX
+
+AT_COMPILE_CXX([parser], [[x[1-8].o -DCC_IS_CXX=$CC_IS_CXX main.cc]])
+AT_CHECK([./parser], [0], [[expout]])
+
 m4_popdef([AT_TEST])
 
 AT_CLEANUP