[flang-commits] [PATCH] D84334: Version information in flang/f18

Camille Coti via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Aug 4 15:06:07 PDT 2020


coti marked an inline comment as done.
coti added a comment.

I am writing the tests.

I have a little problem with` __flang_version__. It looks like f18 considers it as a numeric constants that it cannot interpret (probably because it contains too many dots). For example:

  print *, "VERSION", __flang_version__

Gives me:

  /home/users/coti/toto.f90:10:4: error: expected execution part construct
      print *, "VERSION", __flang_version__
       ^
  /home/users/coti/toto.f90:10:3: in the context: execution part
      print *, "VERSION", __flang_version__
      ^
  /home/users/coti/toto.f90:1:1: in the context: main program
    program version
    ^
  f18: could not parse /home/users/coti/toto.f90

Then

  #if __flang_version__ == "12.0.0"
    print *, "Correct version number"
  #endif

gives me:

  /home/users/coti/toto.f90:15:5: error: Uninterpretable numeric constant '12.0.0'
    #if __flang_version__ == "12.0.0"
        ^^^^^^^^^^^^^^^^^
  in a macro defined here
  that expanded to:
    12.0.0
    ^




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84334/new/

https://reviews.llvm.org/D84334



More information about the flang-commits mailing list