A miscompilation issue has been addressed via refined handling. Fixes: https://github.com/llvm/llvm-project/issues/114772. Fixes: https://github.com/llvm/llvm-project/issues/63142.
14 lines
669 B
LLVM
14 lines
669 B
LLVM
; RUN: opt -S -mtriple=amdgcn-- -passes=inferattrs %s | FileCheck -check-prefix=NOBUILTIN %s
|
|
; RUN: opt -S -enable-builtin=malloc -mtriple=amdgcn-- -passes=inferattrs %s | FileCheck -check-prefix=WITHBUILTIN %s
|
|
|
|
; Test that the -enable-builtin flag works and forces recognition of
|
|
; malloc despite the target's default TargetLibraryInfo.
|
|
|
|
; NOBUILTIN: declare ptr @malloc(i64)
|
|
|
|
; WITHBUILTIN: declare noalias noundef ptr @malloc(i64 noundef) #0
|
|
; WITHBUILTIN: attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
|
|
|
|
declare ptr @malloc(i64)
|
|
|