From: Kazu Hirata Date: Fri, 2 Dec 2022 21:37:57 +0000 (-0800) Subject: [Inline] Add a basic test for the module inliner X-Git-Tag: upstream/17.0.6~25519 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0417b9d63735f70fa9c7fe35ba052665994bd546;p=platform%2Fupstream%2Fllvm.git [Inline] Add a basic test for the module inliner The new test ensures that the module inliner works with all currently supported priority modes. Different priority modes result in no difference in terms of the output for these simple cases, so this is more of a "better than nothing" test. Differential Revision: https://reviews.llvm.org/D139222 --- diff --git a/llvm/test/Transforms/Inline/module-inliner-basic.ll b/llvm/test/Transforms/Inline/module-inliner-basic.ll new file mode 100644 index 0000000..4fede8a --- /dev/null +++ b/llvm/test/Transforms/Inline/module-inliner-basic.ll @@ -0,0 +1,20 @@ +; RUN: opt -passes=module-inline -S < %s | FileCheck %s +; RUN: opt -passes=module-inline -inline-priority-mode=size -S < %s | FileCheck %s +; RUN: opt -passes=module-inline -inline-priority-mode=cost -S < %s | FileCheck %s +; RUN: opt -passes=module-inline -inline-priority-mode=cost-benefit -S < %s | FileCheck %s + +define i32 @callee(i32 %a) { +entry: + %add = add nsw i32 %a, 1 + ret i32 %add +} + +define i32 @caller(i32 %a) { +entry: + %call = call i32 @callee(i32 %a) + ret i32 %call +} + +; CHECK-LABEL: @caller +; CHECK-NOT: call +; CHECK: ret