Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/asan/function-argument-2.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// { dg-do run } // { dg-shouldfail "asan" } static __attribute__ ((noinline)) int goo (int *a) { return *(volatile int *)a; } __attribute__ ((noinline)) int foo (char arg) { return goo ((int *)&arg); } int main () { return foo (12); } // { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow on address.*(\n|\r\n|\r)" } // { dg-output "READ of size . at.*" } // { dg-output ".*'arg' \\(line 11\\) <== Memory access at offset \[0-9\]* partially overflows this variable.*" }