xref: /llvm-project/llvm/test/Transforms/FunctionSpecialization/compiler-crash-58759.ll (revision 06664fdc7680f7f9fa9b0a414a8fb8df2f913d48)
1; RUN: opt -S --passes="default<O3>" -funcspec-for-literal-constant=false < %s | FileCheck %s
2
3define dso_local i32 @g0(i32 noundef %x) local_unnamed_addr {
4entry:
5  %call = tail call fastcc i32 @f(i32 noundef %x, ptr noundef nonnull @p0)
6  ret i32 %call
7}
8
9define internal fastcc i32 @f(i32 noundef %x, ptr nocapture noundef readonly %p) noinline {
10entry:
11  %call = tail call i32 %p(i32 noundef %x)
12  %add = add nsw i32 %call, %x
13  ret i32 %add
14}
15
16define dso_local i32 @g1(i32 noundef %x) {
17entry:
18  %call = tail call fastcc i32 @f(i32 noundef %x, ptr noundef nonnull @p1)
19  ret i32 %call
20}
21
22declare i32 @p0(i32 noundef)
23declare i32 @p1(i32 noundef)
24
25;; Tests that `f` has been fully specialize and it didn't cause compiler crash.
26;; CHECK-DAG: f.specialized.1
27;; CHECK-DAG: f.specialized.2
28