summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-10-10 13:09:09 (GMT)
committerBrad King <brad.king@kitware.com>2007-10-10 13:09:09 (GMT)
commitaa9ba5c3efcd32ea631435318f63dc476ac39798 (patch)
tree7cde06b78ec51ef50142455d70ca8c2da9c7c86f /Tests
parentea56464864674a8dd13e417c69d68bd9a80ff5fa (diff)
downloadCMake-aa9ba5c3efcd32ea631435318f63dc476ac39798.zip
CMake-aa9ba5c3efcd32ea631435318f63dc476ac39798.tar.gz
CMake-aa9ba5c3efcd32ea631435318f63dc476ac39798.tar.bz2
ENH: Added test for 'use' keyword in a comment. Patch from Maik Beckmann. See bug#5809.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Fortran/CMakeLists.txt10
-rw-r--r--Tests/Fortran/in_interface/main.f903
-rw-r--r--Tests/Fortran/in_interface/module.f9012
-rw-r--r--Tests/Fortran/test_use_in_comment_fixedform.f7
-rw-r--r--Tests/Fortran/test_use_in_comment_freeform.f907
5 files changed, 39 insertions, 0 deletions
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index 99132de..c6c6689 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -12,4 +12,14 @@ IF(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
test_module_main.f90
test_module_implementation.f90
test_module_interface.f90)
+
+ ADD_EXECUTABLE(test_use_in_comment_fixedform
+ test_use_in_comment_fixedform.f)
+ ADD_EXECUTABLE(test_use_in_comment_freeform
+ test_use_in_comment_freeform.f90)
+
+ ADD_EXECUTABLE(test_in_interface
+ in_interface/main.f90
+ in_interface/module.f90)
+
ENDIF(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
diff --git a/Tests/Fortran/in_interface/main.f90 b/Tests/Fortran/in_interface/main.f90
new file mode 100644
index 0000000..28bcf36
--- /dev/null
+++ b/Tests/Fortran/in_interface/main.f90
@@ -0,0 +1,3 @@
+program hello
+ use test_interface
+end program hello
diff --git a/Tests/Fortran/in_interface/module.f90 b/Tests/Fortran/in_interface/module.f90
new file mode 100644
index 0000000..1064d74
--- /dev/null
+++ b/Tests/Fortran/in_interface/module.f90
@@ -0,0 +1,12 @@
+module test_interface
+
+ interface dummy
+ module procedure module_function
+ end interface
+
+contains
+
+ subroutine module_function
+ end subroutine
+
+end module test_interface \ No newline at end of file
diff --git a/Tests/Fortran/test_use_in_comment_fixedform.f b/Tests/Fortran/test_use_in_comment_fixedform.f
new file mode 100644
index 0000000..e670939
--- /dev/null
+++ b/Tests/Fortran/test_use_in_comment_fixedform.f
@@ -0,0 +1,7 @@
+ PROGRAM foo
+C USE bar
+C use bar
+C Use bar
+
+ WRITE(*,*) 'Hello, Fortran world.'
+ END PROGRAM
diff --git a/Tests/Fortran/test_use_in_comment_freeform.f90 b/Tests/Fortran/test_use_in_comment_freeform.f90
new file mode 100644
index 0000000..c992a04
--- /dev/null
+++ b/Tests/Fortran/test_use_in_comment_freeform.f90
@@ -0,0 +1,7 @@
+PROGRAM foo
+! USE bar
+! use bar
+! Use bar
+
+ WRITE(*,*) 'Hello, Fortran world.'
+END PROGRAM