llvm-project/flang/test/Semantics/line-directive.f90
Peter Klausler e12ffe6a93
[flang] Honor #line and related preprocessing directives
Extend the SourceFile class to take account of #line directives
when computing source file positions for error messages.
Adjust the output of #line directives to -E output so that they
reflect any #line directives that were in the input.

Differential Revision: https://reviews.llvm.org/D153910
2023-06-29 08:27:37 -07:00

19 lines
554 B
Fortran

!RUN: not %flang -fsyntax-only %s 2>&1 | FileCheck %s
subroutine s
implicit none
!CHECK: line-directive.f90:5:3: error: No explicit type declared for 'a'
a = 1.
#line 100
!CHECK: line-directive.f90:101:3: error: No explicit type declared for 'b'
b = 2.
#line "sourceFile.cobol" 200
!CHECK: sourceFile.cobol:201:3: error: No explicit type declared for 'c'
c = 3.
# 300
!CHECK: sourceFile.cobol:301:3: error: No explicit type declared for 'd'
d = 4.
# "/dev/random" 400
!CHECK: random:401:3: error: No explicit type declared for 'e'
e = 5.
end