Skip to content

Commit f803603

Browse files
committed
add llvm test
1 parent 9e0c54b commit f803603

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s
2+
3+
// integer :: x(:)
4+
// omp target has_device_addr(x)
5+
6+
// CHECK-LABEL: ModuleID
7+
// CHECK: @.offload_sizes = private unnamed_addr constant [1 x i64] [i64 48]
8+
// CHECK: @.offload_maptypes = private unnamed_addr constant [1 x i64] [i64 549]
9+
10+
module attributes { llvm.target_triple = "x86_64-unknown-linux-gnu", omp.target_triples = ["amdgcn-amd-amdhsa"], omp.version = #omp.version<version = 52>} {
11+
llvm.func @has_device_addr(%arg0: !llvm.ptr) attributes {target_cpu = "x86-64"} {
12+
%0 = llvm.mlir.constant(1 : i32) : i32
13+
%1 = llvm.alloca %0 x !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8, array<1 x array<3 x i64>>)> {alignment = 8 : i64} : (i32) -> !llvm.ptr
14+
%41 = omp.map.info var_ptr(%1 : !llvm.ptr, !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8, array<1 x array<3 x i64>>)>) map_clauses(always, implicit, to) capture(ByRef) -> !llvm.ptr {name = "x"}
15+
omp.target has_device_addr(%41 -> %arg1 : !llvm.ptr) {
16+
omp.terminator
17+
}
18+
llvm.return
19+
}
20+
}

0 commit comments

Comments
 (0)