xref: /llvm-project/llvm/test/Transforms/InstCombine/call-cast-target-inalloca.ll (revision 32a4566fbb43f7195fd51fbe453b980897cec3fc)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2; RUN: opt < %s -passes=instcombine -S | FileCheck %s
3
4target datalayout = "e-p:32:32"
5target triple = "i686-pc-linux-gnu"
6
7declare void @takes_i32(i32)
8declare void @takes_i32_inalloca(ptr inalloca(i32))
9
10define void @f() {
11; CHECK-LABEL: define void @f() {
12; CHECK-NEXT:    [[ARGS:%.*]] = alloca inalloca i32, align 4
13; CHECK-NEXT:    call void @takes_i32(ptr nonnull inalloca(i32) [[ARGS]])
14; CHECK-NEXT:    ret void
15;
16  %args = alloca inalloca i32
17  call void @takes_i32(ptr inalloca(i32) %args)
18  ret void
19}
20
21define void @g() {
22; CHECK-LABEL: define void @g() {
23; CHECK-NEXT:    call void @takes_i32_inalloca(i32 0)
24; CHECK-NEXT:    ret void
25;
26  call void @takes_i32_inalloca(i32 0)
27  ret void
28}
29