summaryrefslogtreecommitdiffstats
path: root/testConfigure.cxx
diff options
context:
space:
mode:
authorKWSys Upstream <kwrobot@kitware.com>2017-11-30 13:15:37 (GMT)
committerBrad King <brad.king@kitware.com>2017-11-30 13:52:44 (GMT)
commit5fa414594eb4c1ca9e7041eb443d503ff495d90d (patch)
tree37e9c5982c32e05c2e6d1606400ebc8a6861b04d /testConfigure.cxx
parente8d0b4312e0454ed3a0787acb2ecbef2c3a364a9 (diff)
downloadCMake-5fa414594eb4c1ca9e7041eb443d503ff495d90d.zip
CMake-5fa414594eb4c1ca9e7041eb443d503ff495d90d.tar.gz
CMake-5fa414594eb4c1ca9e7041eb443d503ff495d90d.tar.bz2
KWSys 2017-11-30 (fa1ab7b8)
Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit fa1ab7b8d790498359ab1b1bff522a7401a918fc (master). Upstream Shortlog ----------------- Brad King (1): 1b09cf0d Configure: Add KWSYS_FALLTHROUGH macro for C++ code
Diffstat (limited to 'testConfigure.cxx')
-rw-r--r--testConfigure.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/testConfigure.cxx b/testConfigure.cxx
new file mode 100644
index 0000000..916dcc1
--- /dev/null
+++ b/testConfigure.cxx
@@ -0,0 +1,30 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+file Copyright.txt or https://cmake.org/licensing#kwsys for details. */
+#include "kwsysPrivate.h"
+#include KWSYS_HEADER(Configure.hxx)
+
+// Work-around CMake dependency scanning limitation. This must
+// duplicate the above list of headers.
+#if 0
+#include "Configure.hxx.in"
+#endif
+
+static bool testFallthrough(int n)
+{
+ int r = 0;
+ switch (n) {
+ case 1:
+ ++r;
+ KWSYS_FALLTHROUGH;
+ default:
+ ++r;
+ }
+ return r == 2;
+}
+
+int testConfigure(int, char* [])
+{
+ bool res = true;
+ res = testFallthrough(1) && res;
+ return res ? 0 : 1;
+}