File: preproc_if_elif_else.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 (33 lines) | stat: -rw-r--r-- 641 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
28
29
30
31
32
33
subroutine preprocessor_if_elif_else()

! This file, as used in test_preproc, and together with the two similar files,
! tests that when there is an if-elif-elif-else, only the first branch that
! evaluates to true is used, and the others ignored. Also when multiple
! conditions evaluate to true.

#if 0
#define PART1 0
#elif 0
#define PART2 0
#elif 0
#define PART3 0
#else
#define PART4 1
#endif

#ifndef PART1
#define PART1 0
#endif
#ifndef PART2
#define PART2 0
#endif
#ifndef PART3
#define PART3 0
#endif
#ifndef PART4
#define PART4 0
#endif

integer, parameter :: res = PART1+PART2+PART3+PART4

endsubroutine preprocessor_if_elif_else