llvm-project/flang/test/Lower/pre-fir-tree03.f90
Eugene Epshteyn 413e71b700
[flang] Main program symbol no longer conflicts with the other symbols (#149169)
The following code is now accepted:
```
module m
end
program m
use m
end
```
The PROGRAM name doesn't really have an effect on the compilation
result, so it shouldn't result in symbol name conflicts.

This change makes the main program symbol name all uppercase in the
cooked character stream. This makes it distinct from all other symbol
names that are all lowercase in cooked character stream.

Modified the tests that were checking for lower case main program name.
2025-07-17 14:18:21 -04:00

61 lines
1.3 KiB
Fortran

! RUN: %flang_fc1 -fdebug-pre-fir-tree -fopenmp %s | FileCheck %s
! Test Pre-FIR Tree captures OpenMP related constructs
! CHECK: Program TEST_OMP
program test_omp
! CHECK: PrintStmt
print *, "sequential"
! CHECK: <<OpenMPConstruct>>
!$omp parallel
! CHECK: PrintStmt
print *, "in omp //"
! CHECK: <<OpenMPConstruct>>
!$omp do
! CHECK: <<DoConstruct>>
! CHECK: LabelDoStmt
do i=1,100
! CHECK: PrintStmt
print *, "in omp do"
! CHECK: EndDoStmt
end do
! CHECK: <<End DoConstruct>>
! CHECK: OmpEndLoopDirective
!$omp end do
! CHECK: <<End OpenMPConstruct>>
! CHECK: PrintStmt
print *, "not in omp do"
! CHECK: <<OpenMPConstruct>>
!$omp do
! CHECK: <<DoConstruct>>
! CHECK: LabelDoStmt
do i=1,100
! CHECK: PrintStmt
print *, "in omp do"
! CHECK: EndDoStmt
end do
! CHECK: <<End DoConstruct>>
! CHECK: <<End OpenMPConstruct>>
! CHECK-NOT: OmpEndLoopDirective
! CHECK: PrintStmt
print *, "no in omp do"
!$omp end parallel
! CHECK: <<End OpenMPConstruct>>
! CHECK: PrintStmt
print *, "sequential again"
! CHECK: <<OpenMPConstruct>>
!$omp task
! CHECK: PrintStmt
print *, "in task"
!$omp end task
! CHECK: <<End OpenMPConstruct>>
! CHECK: PrintStmt
print *, "sequential again"
end program