1// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s 2 3module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_device = true} { 4 llvm.func @_QQmain() { 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) 11 omp.terminator 12 } 13 llvm.return 14 } loc(#loc3) 15} 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]) 26 27// CHECK-DAG: ![[SP:.*]] = {{.*}}!DISubprogram(name: "__omp_offloading_{{.*}}"{{.*}}) 28// CHECK-DAG: !DILocation(line: 46, column: 3, scope: ![[SP]]) 29