1 ; RUN: opt < %s -inline -S | FileCheck %s
3 ; InlineCost used to have problems with the ptrtoint, leading to
4 ; crashes when visiting the trunc in pr47969_help and the icmp in
7 target datalayout = "p:16:16"
8 target triple = "x86_64-unknown-linux-gnu"
10 define void @pr47969_help(i16* %p) {
11 %cast = ptrtoint i16* %p to i32
12 %sub = sub i32 %cast, %cast
13 %conv = trunc i32 %sub to i16
17 define void @pr47969(i16* %x) {
18 call void @pr47969_help(i16* %x)
22 ; CHECK-LABEL: @pr47969(i16* %x)
26 define void @pr38500_help(i16* %p) {
27 %cast = ptrtoint i16* %p to i32
28 %sub = sub i32 %cast, %cast
29 %cmp = icmp eq i32 %sub, 0
33 define void @pr38500(i16* %x) {
34 call void @pr38500_help(i16* %x)
38 ; CHECK-LABEL: @pr38500(i16* %x)