Files
clang-p2996/flang/test/Preprocessing/renaming.F
Peter Klausler 9efe158150 [flang][preprocessing] Allow keyword macro to rename a function-like macro
#define FOO(x) ((x)+1)
 #define BAR FOO
 print *, BAR(1)

should work as one would expect.

Fixes https://github.com/llvm/llvm-project/issues/47162.

Differential Revision: https://reviews.llvm.org/D151154
2023-05-22 14:43:45 -07:00

9 lines
288 B
Fortran

! RUN: %flang -E %s | FileCheck %s
! CHECK: ((1)*10000+(11)*100)
! Ensure that a keyword-like macro can be used to rename a
! function-like macro.
#define TO_VERSION2(MAJOR, MINOR) ((MAJOR) * 10000 + (MINOR) * 100)
#define TO_VERSION TO_VERSION2
print *, TO_VERSION(1,11)
end