brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 6cf75af Raw
35 lines · plain
1// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s2 3// Same test as omptarget-debug.mlir but with is_target_device = false.4// Somehow test with omp.target don't work with -split-input-file.5module attributes {omp.is_target_device = false} {6  llvm.func @_QQmain() {7    %0 = llvm.mlir.constant(1 : i32) : i328    %1 = llvm.alloca %0 x i32 : (i32) -> !llvm.ptr9    %9 = omp.map.info var_ptr(%1 : !llvm.ptr, i32) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}10    omp.target map_entries(%9 -> %arg0 : !llvm.ptr) {11      %13 = llvm.mlir.constant(1 : i32) : i3212      llvm.store %13, %arg0 : i32, !llvm.ptr loc(#loc2)13      omp.terminator14    }  loc(#loc4)15    llvm.return16  } loc(#loc3)17}18#file = #llvm.di_file<"target.f90" in "">19#cu = #llvm.di_compile_unit<id = distinct[0]<>,20 sourceLanguage = DW_LANG_Fortran95, file = #file, isOptimized = false,21 emissionKind = LineTablesOnly>22#sp_ty = #llvm.di_subroutine_type<callingConvention = DW_CC_normal>23#sp = #llvm.di_subprogram<id = distinct[1]<>, compileUnit = #cu, scope = #file,24 name = "_QQmain", file = #file, subprogramFlags = "Definition", type = #sp_ty>25#sp1 = #llvm.di_subprogram<id = distinct[2]<>, compileUnit = #cu, scope = #file,26 name = "__omp_offloading_target", file = #file, subprogramFlags = "Definition",27 type = #sp_ty>28#loc1 = loc("target.f90":1:1)29#loc2 = loc("target.f90":46:3)30#loc3 = loc(fused<#sp>[#loc1])31#loc4 = loc(fused<#sp1>[#loc1])32 33// CHECK-DAG: ![[SP:.*]] = {{.*}}!DISubprogram(name: "__omp_offloading_target"{{.*}})34// CHECK-DAG: !DILocation(line: 46, column: 3, scope: ![[SP]])35