llvm-project/flang/test/Lower/return-statement.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

35 lines
667 B
Fortran

! RUN: bbc %s -o "-" -emit-fir -hlfir=false | FileCheck %s
program basic
return
end program
! CHECK-LABEL: func @_QQmain() attributes {fir.bindc_name = "BASIC"} {
! CHECK: return
! CHECK: }
subroutine sub1()
return
end
! CHECK-LABEL: func @_QPsub1() {
! CHECK: cf.br ^bb1
! CHECK: ^bb1: // pred: ^bb0
! CHECK: return
subroutine sub2()
goto 3
2 return
3 goto 2
end
! CHECK-LABEL: func @_QPsub2() {
! CHECK: cf.br ^bb2
! CHECK: ^bb1: // pred: ^bb2
! CHECK: cf.br ^bb3
! CHECK: ^bb2: // pred: ^bb0
! CHECK: cf.br ^bb1
! CHECK: ^bb3: // pred: ^bb1
! CHECK: return