brintos

brintos / llvm-project-archived public Read only

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