Skip to content

Commit 82125cc

Browse files
committed
- Created test for inlined compiler directives
1 parent aeb12e9 commit 82125cc

File tree

3 files changed

+29
-35
lines changed

3 files changed

+29
-35
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s
2+
3+
! Test that checks whether compiler directives can be inlined without mistaking it as comment.
4+
5+
module m
6+
contains
7+
#define MACRO(X) subroutine func1(X); real(2) :: X; !dir$ ignore_tkr(d) X; end subroutine func1;
8+
MACRO(foo)
9+
10+
!CHECK: SUBROUTINE func1 (foo)
11+
!CHECK: !DIR$ IGNORE_TKR (d) foo
12+
!CHECK: END SUBROUTINE func1
13+
14+
subroutine func2(foo)
15+
real(2) :: foo; !dir$ ignore_tkr(d) foo;
16+
end subroutine func2
17+
18+
!CHECK: SUBROUTINE func2 (foo)
19+
!CHECK: !DIR$ IGNORE_TKR (d) foo
20+
!CHECK: END SUBROUTINE func2
21+
22+
subroutine func3(foo)
23+
real(2) :: foo; !dir$ ignore_tkr(d) foo; end subroutine func3;
24+
25+
!CHECK: SUBROUTINE func3 (foo)
26+
!CHECK: !DIR$ IGNORE_TKR (d) foo
27+
!CHECK: END SUBROUTINE func3
28+
29+
end module

flang/test/temp_test/m.mod

Lines changed: 0 additions & 16 deletions
This file was deleted.

flang/test/temp_test/test.f90

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)