summaryrefslogtreecommitdiff
path: root/Tests/CxxSubdirC/main.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-12-22 19:55:08 -0500
committerBrad King <brad.king@kitware.com>2014-12-22 20:13:40 -0500
commit07fc7b75ef981300e7d873091ee90083b18d1c4a (patch)
treec869f64c456c00ccfccf81de7b8baa0e0a081881 /Tests/CxxSubdirC/main.cxx
parentfdbfcfdf0173c34845e495f4c0bd407faafc45b4 (diff)
downloadcmake-07fc7b75ef981300e7d873091ee90083b18d1c4a.tar.gz
Tests: Test using objects from a language enabled in a subdirectory (#15325)
Add a test case that enables CXX in the top level and C in a subdirectory. Create an executable in the top level that uses C objects compiled in the subdirectory. Strictly speaking this is not defined behavior for all language combinations, but happens to work in this case. Test this behavior since projects might try to use it.
Diffstat (limited to 'Tests/CxxSubdirC/main.cxx')
-rw-r--r--Tests/CxxSubdirC/main.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/Tests/CxxSubdirC/main.cxx b/Tests/CxxSubdirC/main.cxx
new file mode 100644
index 0000000000..049220f116
--- /dev/null
+++ b/Tests/CxxSubdirC/main.cxx
@@ -0,0 +1,2 @@
+extern "C" int Cobj(void);
+int main() { return Cobj(); }