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
19 lines
340 B
Fortran
19 lines
340 B
Fortran
! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s
|
|
!CHECK: #line "{{.*[/\\]}}line-directive.f90" 3
|
|
subroutine s
|
|
implicit none
|
|
a = 1.
|
|
#line 100
|
|
!CHECK: #line 101
|
|
b = 2.
|
|
#line "sourceFile.cobol" 200
|
|
!CHECK: #line "sourceFile.cobol" 201
|
|
c = 3.
|
|
# 300
|
|
!CHECK: #line 301
|
|
d = 4.
|
|
# "/dev/random" 400
|
|
!CHECK: #line "/dev/random" 401
|
|
e = 5.
|
|
end
|