summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
diff options
context:
space:
mode:
authorErik Pilkington <erik.pilkington@gmail.com>2019-05-31 22:41:36 +0000
committerErik Pilkington <erik.pilkington@gmail.com>2019-05-31 22:41:36 +0000
commitabb2a93c5327ad21d057164539ee06d27f733b71 (patch)
tree6f7d175e85496b68aa4ff78c7820360a728d8439 /llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
parent5234921119f95138e2a0802369b7b092ddb7cc4a (diff)
downloadbcm5719-llvm-abb2a93c5327ad21d057164539ee06d27f733b71.tar.gz
bcm5719-llvm-abb2a93c5327ad21d057164539ee06d27f733b71.zip
[SimplifyLibCalls] Fold more fortified functions into non-fortified variants
When the object size argument is -1, no checking can be done, so calling the _chk variant is unnecessary. We already did this for a bunch of these functions. rdar://50797197 Differential revision: https://reviews.llvm.org/D62358 llvm-svn: 362272
Diffstat (limited to 'llvm/unittests/Analysis/TargetLibraryInfoTest.cpp')
-rw-r--r--llvm/unittests/Analysis/TargetLibraryInfoTest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp b/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
index 43776f607a1..00b1e94863b 100644
--- a/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
+++ b/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
@@ -313,6 +313,8 @@ TEST_F(TargetLibraryInfoTest, ValidProto) {
"declare i8* @strtok(i8*, i8*)\n"
"declare i8* @strtok_r(i8*, i8*, i8**)\n"
"declare i64 @strtol(i8*, i8**, i32)\n"
+ "declare i64 @strlcat(i8*, i8**, i64)\n"
+ "declare i64 @strlcpy(i8*, i8**, i64)\n"
"declare x86_fp80 @strtold(i8*, i8**)\n"
"declare i64 @strtoll(i8*, i8**, i32)\n"
"declare i64 @strtoul(i8*, i8**, i32)\n"
@@ -467,6 +469,15 @@ TEST_F(TargetLibraryInfoTest, ValidProto) {
"declare i8* @__stpncpy_chk(i8*, i8*, i64, i64)\n"
"declare i8* @__strcpy_chk(i8*, i8*, i64)\n"
"declare i8* @__strncpy_chk(i8*, i8*, i64, i64)\n"
+ "declare i8* @__memccpy_chk(i8*, i8*, i32, i64)\n"
+ "declare i32 @__snprintf_chk(i8*, i64, i32, i64, i8*, ...)\n"
+ "declare i32 @__sprintf_chk(i8*, i32, i64, i8*, ...)\n"
+ "declare i8* @__strcat_chk(i8*, i8*, i64)\n"
+ "declare i64 @__strlcat_chk(i8*, i8*, i64, i64)\n"
+ "declare i8* @__strncat_chk(i8*, i8*, i64, i64)\n"
+ "declare i64 @__strlcpy_chk(i8*, i8*, i64, i64)\n"
+ "declare i32 @__vsnprintf_chk(i8*, i64, i32, i64, i8*, %struct*)\n"
+ "declare i32 @__vsprintf_chk(i8*, i32, i64, i8*, %struct*)\n"
"declare i8* @memalign(i64, i64)\n"
"declare i8* @mempcpy(i8*, i8*, i64)\n"
OpenPOWER on IntegriCloud