1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --scrub-attributes
2; RUN: opt -S -passes=instcombine < %s | FileCheck %s
3
4define dso_local void @test() local_unnamed_addr #0 {
5; CHECK-LABEL: @test(
6; CHECK-NEXT:    ret void
7;
8  %1 = tail call noalias align 16 dereferenceable_or_null(4) i8* @malloc(i64 4) #4
9  %2 = tail call align 16 dereferenceable_or_null(6) i8* @realloc(i8* %1, i64 6) #4
10  tail call void @free(i8* %2) #4
11  ret void
12}
13
14declare dso_local noalias noundef i8* @malloc(i64 noundef) local_unnamed_addr #1
15declare dso_local noalias noundef i8* @realloc(i8* nocapture allocptr, i64 noundef) local_unnamed_addr #2
16declare dso_local void @free(i8* nocapture allocptr noundef) local_unnamed_addr #2
17declare void @llvm.dbg.value(metadata, metadata, metadata) #3
18
19attributes #0 = { mustprogress nounwind uwtable willreturn }
20attributes #1 = { inaccessiblememonly mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") "alloc-family"="malloc" }
21attributes #2 = { inaccessiblemem_or_argmemonly mustprogress nounwind willreturn allockind("realloc") "alloc-family"="malloc" }
22attributes #3 = { nofree nosync nounwind readnone speculatable willreturn allockind("free") "alloc-family"="malloc" }
23attributes #4 = { nounwind }
24
25