mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-27 03:48:33 +00:00
174242c74c
With this change all values passed through blacklisted functions become fully initialized. Previous behavior was to initialize all loads in blacklisted functions, but apply normal shadow propagation logic for all other operation. This makes blacklist applicable in a wider range of situations. It also makes code for blacklisted functions a lot shorter, which works as yet another workaround for PR17409. llvm-svn: 212268
25 lines
563 B
C++
25 lines
563 B
C++
// RUN: %clangxx_msan -m64 -O0 %s -o %t && %run %t >%t.out 2>&1
|
|
// RUN: %clangxx_msan -m64 -O1 %s -o %t && %run %t >%t.out 2>&1
|
|
// RUN: %clangxx_msan -m64 -O2 %s -o %t && %run %t >%t.out 2>&1
|
|
// RUN: %clangxx_msan -m64 -O3 %s -o %t && %run %t >%t.out 2>&1
|
|
|
|
// Test that (no_sanitize_memory) functions DO NOT propagate shadow.
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
__attribute__((noinline))
|
|
__attribute__((no_sanitize_memory))
|
|
int f(int x) {
|
|
return x;
|
|
}
|
|
|
|
int main(void) {
|
|
int x;
|
|
int * volatile p = &x;
|
|
int y = f(*p);
|
|
if (y)
|
|
exit(0);
|
|
return 0;
|
|
}
|