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