1 ; RUN: opt < %s -passes=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(ptr %p) {
11 %cast = ptrtoint ptr %p to i32
12 %sub = sub i32 %cast, %cast
13 %conv = trunc i32 %sub to i16
17 define void @pr47969(ptr %x) {
18 call void @pr47969_help(ptr %x)
22 ; CHECK-LABEL: @pr47969(ptr %x)
26 define void @pr38500_help(ptr %p) {
27 %cast = ptrtoint ptr %p to i32
28 %sub = sub i32 %cast, %cast
29 %cmp = icmp eq i32 %sub, 0
33 define void @pr38500(ptr %x) {
34 call void @pr38500_help(ptr %x)
38 ; CHECK-LABEL: @pr38500(ptr %x)