34 lines · plain
1// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s2 3module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memory_space", 5 : ui32>>, llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_device = true} {4 llvm.func @_QQmain() {5 %0 = llvm.mlir.constant(1 : i32) : i326 %1 = llvm.alloca %0 x i32 : (i32) -> !llvm.ptr<5>7 %ascast = llvm.addrspacecast %1 : !llvm.ptr<5> to !llvm.ptr8 %9 = omp.map.info var_ptr(%ascast : !llvm.ptr, i32) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}9 omp.target map_entries(%9 -> %arg0 : !llvm.ptr) {10 %13 = llvm.mlir.constant(1 : i32) : i3211 llvm.store %13, %arg0 : i32, !llvm.ptr loc(#loc2)12 omp.terminator13 } loc(#loc4)14 llvm.return15 } loc(#loc3)16}17#file = #llvm.di_file<"target.f90" in "">18#cu = #llvm.di_compile_unit<id = distinct[0]<>,19 sourceLanguage = DW_LANG_Fortran95, file = #file, isOptimized = false,20 emissionKind = LineTablesOnly>21#sp_ty = #llvm.di_subroutine_type<callingConvention = DW_CC_normal>22#sp = #llvm.di_subprogram<id = distinct[1]<>, compileUnit = #cu, scope = #file,23 name = "_QQmain", file = #file, subprogramFlags = "Definition", type = #sp_ty>24#sp1 = #llvm.di_subprogram<id = distinct[2]<>, compileUnit = #cu, scope = #file,25 name = "__omp_offloading_target", file = #file, subprogramFlags = "Definition",26 type = #sp_ty>27#loc1 = loc("target.f90":1:1)28#loc2 = loc("target.f90":46:3)29#loc3 = loc(fused<#sp>[#loc1])30#loc4 = loc(fused<#sp1>[#loc1])31 32// CHECK-DAG: ![[SP:.*]] = {{.*}}!DISubprogram(name: "__omp_offloading_target"{{.*}})33// CHECK-DAG: !DILocation(line: 46, column: 3, scope: ![[SP]])34