1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instcombine -S | FileCheck %s
4 declare i8* @realloc(i8*, i64) #1
5 declare noalias i8* @malloc(i64) #1
8 define i8* @realloc_null_ptr() #0 {
9 ; CHECK-LABEL: @realloc_null_ptr(
10 ; CHECK-NEXT: [[MALLOC:%.*]] = call i8* @malloc(i64 100)
11 ; CHECK-NEXT: ret i8* [[MALLOC]]
13 %call = call i8* @realloc(i8* null, i64 100) #2
17 define i8* @realloc_unknown_ptr(i8* %ptr) #0 {
18 ; CHECK-LABEL: @realloc_unknown_ptr(
19 ; CHECK-NEXT: [[CALL:%.*]] = call i8* @realloc(i8* [[PTR:%.*]], i64 100)
20 ; CHECK-NEXT: ret i8* [[CALL]]
22 %call = call i8* @realloc(i8* %ptr, i64 100) #2