summaryrefslogtreecommitdiff
path: root/flang/test/Lower/CUDA/cuda-allocatable-device.cuf
diff options
context:
space:
mode:
Diffstat (limited to 'flang/test/Lower/CUDA/cuda-allocatable-device.cuf')
-rw-r--r--flang/test/Lower/CUDA/cuda-allocatable-device.cuf22
1 files changed, 22 insertions, 0 deletions
diff --git a/flang/test/Lower/CUDA/cuda-allocatable-device.cuf b/flang/test/Lower/CUDA/cuda-allocatable-device.cuf
new file mode 100644
index 000000000000..57c588e5beaf
--- /dev/null
+++ b/flang/test/Lower/CUDA/cuda-allocatable-device.cuf
@@ -0,0 +1,22 @@
+! RUN: bbc -emit-hlfir -fcuda %s -o - | FileCheck %s
+
+module m
+ type device_array
+ real(kind=8), allocatable, dimension(:), device :: ad
+ real(kind=8), pointer, dimension(:), device :: pd
+ end type
+
+ type(device_array), allocatable :: da(:)
+end module
+
+! CHECK-LABEL: fir.global linkonce_odr @_QMmE.c.device_array
+! CHECK: fir.insert_value %{{.*}}, %c6{{.*}}, ["genre"
+! CHECK: fir.insert_value %{{.*}}, %c5{{.*}}, ["genre"
+
+program main
+ use m
+ type(device_array) :: local
+end
+
+! CHECK-LABEL: func.func @_QQmain()
+! CHECK: fir.call @_FortranAInitialize