Files
clang-p2996/compiler-rt/test/msan/report-demangling.cpp
Kevin Athey 057cabd997 Remove function name from sanitize-memory-track-origins binary.
This work is being done to reduce the size of MSAN with track origins binary.

Builds upon: https://reviews.llvm.org/D131205

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131415
2022-08-10 15:45:40 -07:00

20 lines
655 B
C++

// Test that function name is mangled in the "created by an allocation" line,
// and demangled in the single-frame "stack trace" that follows.
// RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1
// RUN: FileCheck %s < %t.out && FileCheck %s < %t.out
__attribute__((noinline))
int f() {
int x;
int *volatile p = &x;
return *p;
}
int main(int argc, char **argv) {
return f();
// CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
// CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame
// CHECK: #0 {{.*}} in f{{.*}} {{.*}}report-demangling.cpp:[[@LINE-9]]
}