aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
diff options
context:
space:
mode:
authorSnehasish Kumar <snehasishk@google.com>2024-08-06 17:41:46 -0700
committerGitHub <noreply@github.com>2024-08-06 17:41:46 -0700
commit874890c68241f500501c42730c2829a5d51f2100 (patch)
tree3d62fe99acebc97447029a0db495dc226fadd613 /llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
parent8dfa651a6325760ecd21618c762a1dad9ec79333 (diff)
downloadllvm-874890c68241f500501c42730c2829a5d51f2100.zip
llvm-874890c68241f500501c42730c2829a5d51f2100.tar.gz
llvm-874890c68241f500501c42730c2829a5d51f2100.tar.bz2
Add __size_returning_new variant detection to TLI. (#101564)
Add support to detect __size_returning_new variants defined inproposal P0901R5 to extend to operator new, see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0901r5.html for details. This PR matches the declarations exported by tcmalloc in https://github.com/google/tcmalloc/blob/f2516691d01051defc558679f37720bba88d9862/tcmalloc/malloc_extension.h#L707-L711
Diffstat (limited to 'llvm/unittests/Analysis/TargetLibraryInfoTest.cpp')
-rw-r--r--llvm/unittests/Analysis/TargetLibraryInfoTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp b/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
index d344ebe..d200956 100644
--- a/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
+++ b/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
@@ -472,6 +472,10 @@ TEST_F(TargetLibraryInfoTest, ValidProto) {
"declare i8* @_ZnwmSt11align_val_tRKSt9nothrow_t(i64, i64, %struct*)\n"
"declare i8* @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64, i64, "
"%struct*, i8)\n"
+ "declare %struct @__size_returning_new(i64)\n"
+ "declare %struct @__size_returning_new_hot_cold(i64, i8)\n"
+ "declare %struct @__size_returning_new_aligned(i64, i64)\n"
+ "declare %struct @__size_returning_new_aligned_hot_cold(i64, i64, i8)\n"
"declare void @\"??3@YAXPEAX@Z\"(i8*)\n"
"declare void @\"??3@YAXPEAXAEBUnothrow_t@std@@@Z\"(i8*, %struct*)\n"