summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2017-03-31 03:34:33 +0000
committerKostya Serebryany <kcc@google.com>2017-03-31 03:34:33 +0000
commitb1f802cf800eec3b7523024ca955dbd56213594d (patch)
tree0e7ffb6b0261e8077e5462817f9a532421f2b4bd /llvm/lib
parent0c835d21c08788e7e81a9617651931a017633e10 (diff)
downloadbcm5719-llvm-b1f802cf800eec3b7523024ca955dbd56213594d.tar.gz
bcm5719-llvm-b1f802cf800eec3b7523024ca955dbd56213594d.zip
[libFuzzer] ensure that strncmp is not inlined in a test
llvm-svn: 299177
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Fuzzer/test/SingleStrncmpTest.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Fuzzer/test/SingleStrncmpTest.cpp b/llvm/lib/Fuzzer/test/SingleStrncmpTest.cpp
index dbcc464b0a7..e5601da8632 100644
--- a/llvm/lib/Fuzzer/test/SingleStrncmpTest.cpp
+++ b/llvm/lib/Fuzzer/test/SingleStrncmpTest.cpp
@@ -9,7 +9,8 @@
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
char *S = (char*)Data;
- if (Size >= 6 && !strncmp(S, "qwerty", 6)) {
+ volatile auto Strncmp = &(strncmp); // Make sure strncmp is not inlined.
+ if (Size >= 6 && !Strncmp(S, "qwerty", 6)) {
fprintf(stderr, "BINGO\n");
exit(1);
}
OpenPOWER on IntegriCloud