forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland [flang][cuda] Add c_devptr and bypass output semantic check (l…
…lvm#107353) Add a builtin type for c_devptr since it will need some special handling for some function like c_f_pointer. `c_ptr` is defined as a builtin type and was raising a semantic error if you try to use it in a I/O statement. This patch add a check for c_ptr and c_devptr to bypass the semantic check and allow the variables of these types to be used in I/O. This version of the patch keeps the semantic error when -pedantic is enabled to align with gfortran.
- Loading branch information
1 parent
7cf18ff
commit 92e75c0
Showing
4 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
! RUN: bbc -emit-hlfir -fcuda %s -o - | FileCheck %s | ||
|
||
! Test CUDA Fortran specific type | ||
|
||
subroutine sub1() | ||
use iso_c_binding | ||
use __fortran_builtins, only : c_devptr => __builtin_c_devptr | ||
|
||
type(c_ptr) :: ptr | ||
type(c_devptr) :: dptr | ||
print*,ptr | ||
print*,dptr | ||
end | ||
|
||
! CHECK-LABEL: func.func @_QPsub1() | ||
! CHECK-COUNT-2: %{{.*}} = fir.call @_FortranAioOutputDerivedType |