Mercurial > hg > CbC > CbC_llvm
comparison compiler-rt/test/msan/memcmp_test.cpp @ 150:1d019706d866
LLVM10
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 15:10:13 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
147:c2174574ed3a | 150:1d019706d866 |
---|---|
1 // RUN: %clangxx_msan -O0 -g %s -o %t | |
2 // RUN: not %run %t 2>&1 | FileCheck %s | |
3 // RUN: MSAN_OPTIONS=intercept_memcmp=0 %run %t | |
4 | |
5 #include <string.h> | |
6 #include <stdio.h> | |
7 int main(int argc, char **argv) { | |
8 char a1[4]; | |
9 char a2[4]; | |
10 for (int i = 0; i < argc * 3; i++) | |
11 a2[i] = a1[i] = i; | |
12 int res = memcmp(a1, a2, 4); | |
13 if (!res) | |
14 printf("equals"); | |
15 return 0; | |
16 // CHECK: Uninitialized bytes in MemcmpInterceptorCommon at offset 3 | |
17 // CHECK: MemorySanitizer: use-of-uninitialized-value | |
18 } |