source: CIVL/mods/dev.civl.abc/examples/fortran/conversion/preproc/preproc_all.f

main
Last change on this file was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 820 bytes
Line 
1#include "macros.h"
2
3C A Fortran program example used for testing that
4C ABC shall correctly handle C preprocessor directives
5C defined in Fortran source code.
6C Directives are used mainly for two purposes:
7C 1. User-specified conditional compilation
8C 2. Macro expansion / String substitution
9C Directives tested here are:
10C "include", "define", "undef", "if", "ifdef", "ifndef"
11C "error"
12
13 program HelloWorld
14#if NUM_MSG==1
15 print *, MSG_HW
16#elif NUM_MSG==2
17 print *, MSG_HW
18 print *, MSG_HI, NAME
19#elif NUM_MSG>=3
20 print *, MSG_HW
21 print *, MSG_HI, NAME
22#ifdef BYE
23 print *, MSG_BW
24#undef BYE
25#endif
26#ifdef BYE
27#error "BYE should be undefined."
28#endif
29#else
30 print *, MSG_NM
31#endif
32 end
Note: See TracBrowser for help on using the repository browser.