1*7c3d14c8STreehugger Robot // RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \ 2*7c3d14c8STreehugger Robot // RUN: not %run %t 2>&1 | FileCheck %s 3*7c3d14c8STreehugger Robot 4*7c3d14c8STreehugger Robot int *p; 5*7c3d14c8STreehugger Robot bool b = true; 6*7c3d14c8STreehugger Robot main()7*7c3d14c8STreehugger Robotint main() { 8*7c3d14c8STreehugger Robot if (b) { 9*7c3d14c8STreehugger Robot int x[5]; 10*7c3d14c8STreehugger Robot p = x+1; 11*7c3d14c8STreehugger Robot } 12*7c3d14c8STreehugger Robot return *p; // BOOM 13*7c3d14c8STreehugger Robot // CHECK: ERROR: AddressSanitizer: stack-use-after-scope 14*7c3d14c8STreehugger Robot // CHECK: #0 0x{{.*}} in main {{.*}}.cc:[[@LINE-2]] 15*7c3d14c8STreehugger Robot } 16