xref: /llvm-project/compiler-rt/test/msan/report-demangling.cpp (revision 057cabd997aeaef136e1e14f2ee645bd5bb197dd)
1d21b3d34SFangrui Song // Test that function name is mangled in the "created by an allocation" line,
2d21b3d34SFangrui Song // and demangled in the single-frame "stack trace" that follows.
3d21b3d34SFangrui Song 
4d21b3d34SFangrui Song // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1
5d21b3d34SFangrui Song // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out
6d21b3d34SFangrui Song 
7d21b3d34SFangrui Song __attribute__((noinline))
f()8d21b3d34SFangrui Song int f() {
9d21b3d34SFangrui Song   int x;
10d21b3d34SFangrui Song   int *volatile p = &x;
11d21b3d34SFangrui Song   return *p;
12d21b3d34SFangrui Song }
13d21b3d34SFangrui Song 
main(int argc,char ** argv)14d21b3d34SFangrui Song int main(int argc, char **argv) {
15d21b3d34SFangrui Song   return f();
16d21b3d34SFangrui Song   // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
17*057cabd9SKevin Athey   // CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame
18d7a47a9bSKevin Athey   // CHECK: #0 {{.*}} in f{{.*}} {{.*}}report-demangling.cpp:[[@LINE-9]]
19d21b3d34SFangrui Song }
20