// RUN: fir-opt %s --split-input-file -o /dev/null --mlir-disable-threading \ // RUN: -pass-pipeline='builtin.module(func.func(test-fir-alias-analysis))' \ // RUN: 2>&1 | FileCheck -match-full-lines %s fir.global @device_global1 {data_attr = #cuf.cuda} : i32 fir.global @device_global2 {data_attr = #cuf.cuda} : i32 fir.global @device_target {data_attr = #cuf.cuda, target} : i32 fir.global @device_pointer {data_attr = #cuf.cuda} : !fir.box> func.func @test_device_address() { %0 = fir.address_of(@device_global1) {test.ptr = "host_ptr1"} : !fir.ref %1 = cuf.device_address @device_global1 {test.ptr = "device_ptr1"} -> !fir.ref %2 = fir.address_of(@device_global2) {test.ptr = "host_ptr2"} : !fir.ref %3 = cuf.device_address @device_global2 {test.ptr = "device_ptr2"} -> !fir.ref %4 = fir.address_of(@device_target) {test.ptr = "host_target"} : !fir.ref %5 = cuf.device_address @device_target {test.ptr = "device_target"} -> !fir.ref %6 = fir.address_of(@device_pointer) {test.ptr = "host_pointer"} : !fir.ref>> %7 = cuf.device_address @device_pointer {test.ptr = "device_pointer"} -> !fir.ref>> return } // CHECK-LABEL: Testing : "test_device_address" // CHECK: host_ptr1#0 <-> device_ptr1#0: MustAlias // CHECK: host_ptr1#0 <-> host_ptr2#0: NoAlias // CHECK: device_ptr1#0 <-> host_ptr2#0: NoAlias // CHECK: host_ptr1#0 <-> device_ptr2#0: NoAlias // CHECK: device_ptr1#0 <-> device_ptr2#0: NoAlias // CHECK: host_ptr2#0 <-> device_ptr2#0: MustAlias // CHECK: host_ptr1#0 <-> host_target#0: NoAlias // CHECK: device_ptr1#0 <-> host_target#0: NoAlias // CHECK: host_ptr2#0 <-> host_target#0: NoAlias // CHECK: device_ptr2#0 <-> host_target#0: NoAlias // CHECK: host_ptr1#0 <-> device_target#0: NoAlias // CHECK: device_ptr1#0 <-> device_target#0: NoAlias // CHECK: host_ptr2#0 <-> device_target#0: NoAlias // CHECK: device_ptr2#0 <-> device_target#0: NoAlias // CHECK: host_target#0 <-> device_target#0: MustAlias // CHECK: host_ptr1#0 <-> host_pointer#0: NoAlias // CHECK: device_ptr1#0 <-> host_pointer#0: NoAlias // CHECK: host_ptr2#0 <-> host_pointer#0: NoAlias // CHECK: device_ptr2#0 <-> host_pointer#0: NoAlias // CHECK: host_target#0 <-> host_pointer#0: NoAlias // CHECK: device_target#0 <-> host_pointer#0: NoAlias // CHECK: host_ptr1#0 <-> device_pointer#0: NoAlias // CHECK: device_ptr1#0 <-> device_pointer#0: NoAlias // CHECK: host_ptr2#0 <-> device_pointer#0: NoAlias // CHECK: device_ptr2#0 <-> device_pointer#0: NoAlias // CHECK: host_target#0 <-> device_pointer#0: NoAlias // CHECK: device_target#0 <-> device_pointer#0: NoAlias // CHECK: host_pointer#0 <-> device_pointer#0: MustAlias