File: preproc_elif.F90

package info (click to toggle)
fortran-language-server 3.2.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,268 kB
  • sloc: python: 9,688; f90: 1,195; fortran: 30; makefile: 28; ansic: 20
file content (27 lines) | stat: -rw-r--r-- 725 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
subroutine preprocessor_elif(var, var3, var4, var5, var6)

! This file, as used in test_preproc, checks that
! 1. the steps after the preprocessor parsing has fully finished, are only
! using content from the parts within the preprocessor if-elif-else that
! should be used. To do this, it has some regular fortran code within the
! #if and #elif.
! 2. the #endif correctly concludes the if-elif, so any new #define statements
! that come after the #endif, are picked up during the preprocessor parsing.

#if 0
integer, intent(in) :: var
#elif 1
integer, intent(inout) :: var
var = 3
#else
integer, intent(out) :: var
var = 5
#endif

#define OTHERTYPE integer

OTHERTYPE :: var2

PRINT*, var

endsubroutine preprocessor_elif