xref: /llvm-project/llvm/test/Transforms/FunctionSpecialization/no-spec-unused-arg.ll (revision e15d72adac66790a78a51a3087b56b2bde6b778a)
1; RUN: opt -S --passes="ipsccp<func-spec>" -force-specialization -funcspec-for-literal-constant < %s | FileCheck %s
2define internal i32 @f(i32 %x, i32 %y) noinline {
3    ret i32 %x
4}
5
6define i32 @g0() {
7    %r = call i32 @f(i32 1, i32 1)
8    ret i32 %r
9}
10
11define i32 @g1() {
12    %r = call i32 @f(i32 1, i32 2)
13    ret i32 %r
14}
15
16; Check that there are no specialisation of `f`: first parameter is deduced
17; to be a constant without the need for function specialisation and
18; the second parameter is unused.
19
20;  CHECK-NOT: @f.specialized.
21