diff --git a/mlir/test/Target/LLVMIR/Import/basic.ll b/mlir/test/Target/LLVMIR/Import/basic.ll --- a/mlir/test/Target/LLVMIR/Import/basic.ll +++ b/mlir/test/Target/LLVMIR/Import/basic.ll @@ -5,23 +5,9 @@ @global = external global double, align 8 -; -; Linkage on functions. -; - -; CHECK: llvm.func internal @func_internal -define internal void @func_internal() { - ret void -} - ; CHECK: llvm.func @fe(i32) -> f32 declare float @fe(i32) -; CHECK: llvm.func internal spir_funccc @spir_func_internal() -define internal spir_func void @spir_func_internal() { - ret void -} - ; FIXME: function attributes. ; CHECK-LABEL: llvm.func internal @f1(%arg0: i64) -> i32 attributes {dso_local} { ; CHECK-DBG: llvm.func internal @f1(%arg0: i64 loc(unknown)) -> i32 attributes {dso_local} { diff --git a/mlir/test/Target/LLVMIR/Import/func-attrs.ll b/mlir/test/Target/LLVMIR/Import/func-attrs.ll deleted file mode 100644 --- a/mlir/test/Target/LLVMIR/Import/func-attrs.ll +++ /dev/null @@ -1,6 +0,0 @@ -; RUN: mlir-translate -import-llvm %s | FileCheck %s - -; CHECK: llvm.func @foo(%arg0: !llvm.ptr {llvm.byval = i64}, %arg1: !llvm.ptr {llvm.byref = i64}, %arg2: !llvm.ptr {llvm.sret = i64}, %arg3: !llvm.ptr {llvm.inalloca = i64}) -define void @foo(ptr byval(i64) %arg0, ptr byref(i64) %arg1, ptr sret(i64) %arg2, ptr inalloca(i64) %arg3) { - ret void -} diff --git a/mlir/test/Target/LLVMIR/Import/function-attributes.ll b/mlir/test/Target/LLVMIR/Import/function-attributes.ll new file mode 100644 --- /dev/null +++ b/mlir/test/Target/LLVMIR/Import/function-attributes.ll @@ -0,0 +1,40 @@ +; RUN: mlir-translate -import-llvm -split-input-file %s | FileCheck %s + +; CHECK: llvm.func internal @func_internal +define internal void @func_internal() { + ret void +} + +; CHECK: llvm.func internal spir_funccc @spir_func_internal() +define internal spir_func void @spir_func_internal() { + ret void +} + +; // ----- + +; CHECK-LABEL: @func_readnone +; CHECK-SAME: attributes {llvm.readnone} +; CHECK: llvm.return +define void @func_readnone() readnone { + ret void +} + +; CHECK-LABEL: @func_readnone_indirect +; CHECK-SAME: attributes {llvm.readnone} +declare void @func_readnone_indirect() #0 +attributes #0 = { readnone } + +; // ----- + +; CHECK-LABEL: @func_arg_attrs +; CHECK-SAME: !llvm.ptr {llvm.byval = i64} +; CHECK-SAME: !llvm.ptr {llvm.byref = i64} +; CHECK-SAME: !llvm.ptr {llvm.sret = i64} +; CHECK-SAME: !llvm.ptr {llvm.inalloca = i64} +define void @func_arg_attrs( + ptr byval(i64) %arg0, + ptr byref(i64) %arg1, + ptr sret(i64) %arg2, + ptr inalloca(i64) %arg3) { + ret void +} diff --git a/mlir/test/Target/LLVMIR/Import/function_attributes.ll b/mlir/test/Target/LLVMIR/Import/function_attributes.ll deleted file mode 100644 --- a/mlir/test/Target/LLVMIR/Import/function_attributes.ll +++ /dev/null @@ -1,17 +0,0 @@ -; RUN: mlir-translate -import-llvm -split-input-file %s | FileCheck %s - -// ----- - -; CHECK: llvm.func @readnone_attr() attributes {llvm.readnone} -declare void @readnone_attr() #0 -attributes #0 = { readnone } - -// ----- - -; CHECK: llvm.func @readnone_attr() attributes {llvm.readnone} { -; CHECK: llvm.return -; CHECK: } -define void @readnone_attr() readnone { -entry: - ret void -}