1 // RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s
3 module attributes {omp.is_target_device = true} {
5 %0 = llvm.mlir.constant(1 : i32) : i32
6 %1 = llvm.alloca %0 x i32 : (i32) -> !llvm.ptr
7 %9 = omp.map.info var_ptr(%1 : !llvm.ptr, i32) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}
8 omp.target map_entries(%9 -> %arg0 : !llvm.ptr) {
9 %13 = llvm.mlir.constant(1 : i32) : i32
10 llvm.store %13, %arg0 : i32, !llvm.ptr loc(#loc2)
16 #file = #llvm.di_file<"target.f90" in "">
17 #cu = #llvm.di_compile_unit<id = distinct[0]<>,
18 sourceLanguage = DW_LANG_Fortran95, file = #file, isOptimized = false,
19 emissionKind = LineTablesOnly>
20 #sp_ty = #llvm.di_subroutine_type<callingConvention = DW_CC_normal>
21 #sp = #llvm.di_subprogram<id = distinct[1]<>, compileUnit = #cu, scope = #file,
22 name = "_QQmain", file = #file, subprogramFlags = "Definition", type = #sp_ty>
23 #loc1 = loc("target.f90":1:1)
24 #loc2 = loc("target.f90":46:3)
25 #loc3 = loc(fused<#sp>[#loc1])
27 // CHECK-DAG: ![[SP:.*]] = {{.*}}!DISubprogram(name: "__omp_offloading_{{.*}}"{{.*}})
28 // CHECK-DAG: !DILocation(line: 46, column: 3, scope: ![[SP]])