|
5 | 5 |
|
6 | 6 | program test_link
|
7 | 7 |
|
8 |
| -integer :: test_int = 1 |
9 |
| -!$omp declare target link(test_int) |
| 8 | + integer :: test_int = 1 |
| 9 | + !$omp declare target link(test_int) |
10 | 10 |
|
11 |
| -integer :: test_array_1d(3) = (/1,2,3/) |
12 |
| -!$omp declare target link(test_array_1d) |
| 11 | + integer :: test_array_1d(3) = (/1,2,3/) |
| 12 | + !$omp declare target link(test_array_1d) |
13 | 13 |
|
14 |
| -integer, pointer :: test_ptr1 |
15 |
| -!$omp declare target link(test_ptr1) |
| 14 | + integer, pointer :: test_ptr1 |
| 15 | + !$omp declare target link(test_ptr1) |
16 | 16 |
|
17 |
| -integer, target :: test_target = 1 |
18 |
| -!$omp declare target link(test_target) |
| 17 | + integer, target :: test_target = 1 |
| 18 | + !$omp declare target link(test_target) |
19 | 19 |
|
20 |
| -integer, pointer :: test_ptr2 |
21 |
| -!$omp declare target link(test_ptr2) |
| 20 | + integer, pointer :: test_ptr2 |
| 21 | + !$omp declare target link(test_ptr2) |
22 | 22 |
|
23 |
| -!CHECK-DAG: {{%.*}} = omp.map_info var_ptr({{%.*}} : !fir.ref<i32>, i32) map_clauses(implicit, tofrom) capture(ByRef) -> !fir.ref<i32> {name = "test_int"} |
24 |
| -!$omp target |
25 |
| - test_int = test_int + 1 |
26 |
| -!$omp end target |
| 23 | + !CHECK-DAG: {{%.*}} = omp.map_info var_ptr({{%.*}} : !fir.ref<i32>, i32) map_clauses(implicit, tofrom) capture(ByRef) -> !fir.ref<i32> {name = "test_int"} |
| 24 | + !$omp target |
| 25 | + test_int = test_int + 1 |
| 26 | + !$omp end target |
27 | 27 |
|
28 | 28 |
|
29 |
| -!CHECK-DAG: {{%.*}} = omp.map_info var_ptr({{%.*}} : !fir.ref<!fir.array<3xi32>>, !fir.array<3xi32>) map_clauses(implicit, tofrom) capture(ByRef) bounds({{%.*}}) -> !fir.ref<!fir.array<3xi32>> {name = "test_array_1d"} |
30 |
| -!$omp target |
31 |
| - do i = 1,3 |
32 |
| - test_array_1d(i) = i * 2 |
33 |
| - end do |
34 |
| -!$omp end target |
| 29 | + !CHECK-DAG: {{%.*}} = omp.map_info var_ptr({{%.*}} : !fir.ref<!fir.array<3xi32>>, !fir.array<3xi32>) map_clauses(implicit, tofrom) capture(ByRef) bounds({{%.*}}) -> !fir.ref<!fir.array<3xi32>> {name = "test_array_1d"} |
| 30 | + !$omp target |
| 31 | + do i = 1,3 |
| 32 | + test_array_1d(i) = i * 2 |
| 33 | + end do |
| 34 | + !$omp end target |
35 | 35 |
|
36 |
| -allocate(test_ptr1) |
37 |
| -test_ptr1 = 1 |
38 |
| -!CHECK-DAG: {{%.*}} = omp.map_info var_ptr({{%.*}} : !fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.box<!fir.ptr<i32>>) map_clauses(implicit, tofrom) capture(ByRef) members({{%.*}} : !fir.llvm_ptr<!fir.ref<i32>>) -> !fir.ref<!fir.box<!fir.ptr<i32>>> {name = "test_ptr1"} |
39 |
| -!$omp target |
40 |
| - test_ptr1 = test_ptr1 + 1 |
41 |
| -!$omp end target |
| 36 | + allocate(test_ptr1) |
| 37 | + test_ptr1 = 1 |
| 38 | + !CHECK-DAG: {{%.*}} = omp.map_info var_ptr({{%.*}} : !fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.box<!fir.ptr<i32>>) map_clauses(implicit, tofrom) capture(ByRef) members({{%.*}} : !fir.llvm_ptr<!fir.ref<i32>>) -> !fir.ref<!fir.box<!fir.ptr<i32>>> {name = "test_ptr1"} |
| 39 | + !$omp target |
| 40 | + test_ptr1 = test_ptr1 + 1 |
| 41 | + !$omp end target |
42 | 42 |
|
43 |
| -!CHECK-DAG: {{%.*}} = omp.map_info var_ptr({{%.*}} : !fir.ref<i32>, i32) map_clauses(implicit, tofrom) capture(ByRef) -> !fir.ref<i32> {name = "test_target"} |
44 |
| -!$omp target |
45 |
| - test_target = test_target + 1 |
46 |
| -!$omp end target |
| 43 | + !CHECK-DAG: {{%.*}} = omp.map_info var_ptr({{%.*}} : !fir.ref<i32>, i32) map_clauses(implicit, tofrom) capture(ByRef) -> !fir.ref<i32> {name = "test_target"} |
| 44 | + !$omp target |
| 45 | + test_target = test_target + 1 |
| 46 | + !$omp end target |
47 | 47 |
|
48 | 48 |
|
49 |
| -!CHECK-DAG: {{%.*}} = omp.map_info var_ptr({{%.*}} : !fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.box<!fir.ptr<i32>>) map_clauses(implicit, tofrom) capture(ByRef) members({{%.*}} : !fir.llvm_ptr<!fir.ref<i32>>) -> !fir.ref<!fir.box<!fir.ptr<i32>>> {name = "test_ptr2"} |
50 |
| -test_ptr2 => test_target |
51 |
| -!$omp target |
52 |
| - test_ptr2 = test_ptr2 + 1 |
53 |
| -!$omp end target |
| 49 | + !CHECK-DAG: {{%.*}} = omp.map_info var_ptr({{%.*}} : !fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.box<!fir.ptr<i32>>) map_clauses(implicit, tofrom) capture(ByRef) members({{%.*}} : !fir.llvm_ptr<!fir.ref<i32>>) -> !fir.ref<!fir.box<!fir.ptr<i32>>> {name = "test_ptr2"} |
| 50 | + test_ptr2 => test_target |
| 51 | + !$omp target |
| 52 | + test_ptr2 = test_ptr2 + 1 |
| 53 | + !$omp end target |
54 | 54 |
|
55 | 55 | end
|
0 commit comments