diff options
| author | Kostya Serebryany <kcc@google.com> | 2012-03-13 01:04:06 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2012-03-13 01:04:06 +0000 |
| commit | b0712f8e68484633392b501836712013621f2568 (patch) | |
| tree | e3c8014c41228658e008f22eb9a49ca5cbeffaf4 /compiler-rt/lib/asan/output_tests | |
| parent | 5fa2ef4445fa674f93fd87e6a1fc8f9582724b5c (diff) | |
| download | bcm5719-llvm-b0712f8e68484633392b501836712013621f2568.tar.gz bcm5719-llvm-b0712f8e68484633392b501836712013621f2568.zip | |
[asan] output test for memcmp
llvm-svn: 152594
Diffstat (limited to 'compiler-rt/lib/asan/output_tests')
| -rw-r--r-- | compiler-rt/lib/asan/output_tests/memcmp_test.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/output_tests/memcmp_test.cc b/compiler-rt/lib/asan/output_tests/memcmp_test.cc new file mode 100644 index 00000000000..d090e45c47c --- /dev/null +++ b/compiler-rt/lib/asan/output_tests/memcmp_test.cc @@ -0,0 +1,8 @@ +#include <string.h> +int main(int argc, char **argv) { + char a1[] = {argc, 2, 3, 4}; + char a2[] = {1, 2*argc, 3, 4}; +// Check-Common: AddressSanitizer stack-buffer-overflow + int res = memcmp(a1, a2, 4 + argc); // BOOM + return res; +} |

