summaryrefslogtreecommitdiff
path: root/Tests/Simple
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-10-30 15:39:57 -0700
committerAnas Nashif <anas.nashif@intel.com>2012-10-30 15:39:57 -0700
commit035c7fabc3b82cbc9a346c11abe2e9462b4c0379 (patch)
tree7e40f5a790eae329a8c5d3e59f046451767956ff /Tests/Simple
downloadcmake-035c7fabc3b82cbc9a346c11abe2e9462b4c0379.tar.gz
cmake-035c7fabc3b82cbc9a346c11abe2e9462b4c0379.tar.bz2
cmake-035c7fabc3b82cbc9a346c11abe2e9462b4c0379.zip
Imported Upstream version 2.8.9upstream/2.8.9
Diffstat (limited to 'Tests/Simple')
-rw-r--r--Tests/Simple/CMakeLists.txt17
-rw-r--r--Tests/Simple/simple.cxx11
-rw-r--r--Tests/Simple/simpleCLib.c12
-rw-r--r--Tests/Simple/simpleLib.cxx3
-rw-r--r--Tests/Simple/simpleWe.cpp17
5 files changed, 60 insertions, 0 deletions
diff --git a/Tests/Simple/CMakeLists.txt b/Tests/Simple/CMakeLists.txt
new file mode 100644
index 000000000..dc965a733
--- /dev/null
+++ b/Tests/Simple/CMakeLists.txt
@@ -0,0 +1,17 @@
+# a simple test case
+project (Simple)
+
+add_executable (Simple simple.cxx)
+
+add_library (simpleLib STATIC
+ simpleLib.cxx
+ simpleCLib.c
+ simpleWe.cpp
+ )
+
+target_link_libraries (Simple simpleLib)
+
+# make sure optimized libs are not used by debug builds
+if(CMAKE_BUILD_TYPE MATCHES Debug)
+ target_link_libraries(Simple optimized c:/not/here.lib )
+endif(CMAKE_BUILD_TYPE MATCHES Debug)
diff --git a/Tests/Simple/simple.cxx b/Tests/Simple/simple.cxx
new file mode 100644
index 000000000..7bee7c074
--- /dev/null
+++ b/Tests/Simple/simple.cxx
@@ -0,0 +1,11 @@
+extern void simpleLib();
+extern "C" int FooBar();
+extern int bar();
+extern int bar1();
+int main ()
+{
+ FooBar();
+ bar();
+ simpleLib();
+ return 0;
+}
diff --git a/Tests/Simple/simpleCLib.c b/Tests/Simple/simpleCLib.c
new file mode 100644
index 000000000..88fc33efc
--- /dev/null
+++ b/Tests/Simple/simpleCLib.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+
+int FooBar()
+{
+ int class;
+ int private = 10;
+ for ( class = 0; class < private; class ++ )
+ {
+ printf("Count: %d/%d\n", class, private);
+ }
+ return 0;
+}
diff --git a/Tests/Simple/simpleLib.cxx b/Tests/Simple/simpleLib.cxx
new file mode 100644
index 000000000..281d8885a
--- /dev/null
+++ b/Tests/Simple/simpleLib.cxx
@@ -0,0 +1,3 @@
+void simpleLib()
+{
+}
diff --git a/Tests/Simple/simpleWe.cpp b/Tests/Simple/simpleWe.cpp
new file mode 100644
index 000000000..859e07c06
--- /dev/null
+++ b/Tests/Simple/simpleWe.cpp
@@ -0,0 +1,17 @@
+#include <stdio.h>
+
+class Foo
+{
+public:
+ Foo()
+ {
+ printf("This one has nonstandard extension\n");
+ }
+ int getnum() { return 0; }
+};
+
+int bar()
+{
+ Foo f;
+ return f.getnum();
+}