summaryrefslogtreecommitdiff
path: root/flang/test/Preprocessing/bug1126.F90
blob: ae5bb5633581ddb3856e02c35a853e3f8bcf3181 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! RUN: %flang -E %s 2>&1 | FileCheck %s
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#define PREFIX(x) prefix ## x
#define NAME(x) PREFIX(foo ## x)
#define AUGMENT(x) NAME(x ## suffix)

! CHECK: subroutine prefixfoosuffix()
! CHECK: print *, "prefixfoosuffix"
! CHECK: end subroutine prefixfoosuffix
subroutine AUGMENT()()
  print *, TOSTRING(AUGMENT())
end subroutine AUGMENT()

! CHECK: subroutine prefixfoobarsuffix()
! CHECK: print *, "prefixfoobarsuffix"
! CHECK: end subroutine prefixfoobarsuffix
subroutine AUGMENT(bar)()
  print *, TOSTRING(AUGMENT(bar))
end subroutine AUGMENT(bar)