Adds a hint to the warning message to disable a warning and updates the tests to expect this. Also fixes a bug in the storage of canonical spelling of error flags so that they are not used after free.
25 lines
941 B
Plaintext
25 lines
941 B
Plaintext
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
! CUDA Fortran section 2.5.6 restrictions
|
|
module m
|
|
contains
|
|
attributes(device) subroutine devsubr(n)
|
|
integer, intent(in) :: n
|
|
!WARNING: 'x1' should not have the SAVE attribute or initialization in a device subprogram [-Wcuda-usage]
|
|
real, save :: x1
|
|
!WARNING: 'x2' should not have the SAVE attribute or initialization in a device subprogram [-Wcuda-usage]
|
|
real :: x2 = 1.
|
|
!ERROR: Device subprogram 'devsubr' cannot call itself
|
|
if (n > 0) call devsubr(n-1)
|
|
end subroutine
|
|
attributes(global) subroutine globsubr
|
|
end subroutine
|
|
subroutine boring
|
|
end subroutine
|
|
subroutine test
|
|
!ERROR: 'globsubr' is a kernel subroutine and must be called with kernel launch parameters in chevrons
|
|
call globsubr
|
|
!ERROR: Kernel launch parameters in chevrons may not be used unless calling a kernel subroutine
|
|
call boring<<<1,2>>>
|
|
end subroutine
|
|
end module
|