File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ ! RUN: %flang -target amdgcn-- -mmlir -use-alloc-runtime -S -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK
2
+ ! RUN: %flang -target amdgcn-- -S -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-NO-FLAG
3
+
4
+ ! Test to check if usage of flag -use-alloc-runtime results in runtime calls.
5
+
6
+ subroutine allocate_deallocate ()
7
+ real , allocatable :: x
8
+
9
+ allocate (x)
10
+ ! CHECK: call i32 @_FortranAAllocatableAllocate
11
+ ! CHECK-NO-FLAG: call ptr @malloc
12
+
13
+ deallocate (x)
14
+ ! CHECK: call i32 @_FortranAAllocatableDeallocate
15
+ ! CHECK-NO-FLAG: call void @free
16
+ end subroutine
17
+
18
+ subroutine allocate_deallocate_ptr ()
19
+ integer , pointer :: x
20
+
21
+ allocate (x)
22
+ ! CHECK: call i32 @_FortranAPointerAllocate
23
+ ! CHECK-NO-FLAG: call i32 @_FortranAPointerAllocate
24
+
25
+ deallocate (x)
26
+ ! CHECK: call i32 @_FortranAPointerDeallocate
27
+ ! CHECK-NO-FLAG: call i32 @_FortranAPointerDeallocate
28
+ end subroutine
You can’t perform that action at this time.
0 commit comments