Hi!

On Mon, 23 Jan 2017 10:19:33 +0100, Martin Liška <mli...@suse.cz> wrote:
> --- a/gcc/testsuite/gcc.dg/asan/use-after-scope-3.c
> +++ b/gcc/testsuite/gcc.dg/asan/use-after-scope-3.c
> @@ -1,5 +1,6 @@
>  // { dg-do run }
>  // { dg-shouldfail "asan" }
> +// { dg-additional-options "-O0" }

As these tests per "gcc/testsuite/gcc.dg/asan/asan.exp" are run with
"gcc-dg-runtest", which will "cycle through a list of optimization
options as c-torture does", is it really appropriate to hard-code "-O0"
here?  Shouldn't instead be all testing be "dg-skip"ped (or similar)
unless "-O0" is in effect?

> --- a/gcc/testsuite/gcc.dg/asan/use-after-scope-9.c
> +++ b/gcc/testsuite/gcc.dg/asan/use-after-scope-9.c
> @@ -1,5 +1,6 @@
>  // { dg-do run }
>  // { dg-shouldfail "asan" }
> +// { dg-additional-options "-O2 -fdump-tree-asan1" }

Likewise.

(I didn't check any other such test cases.)

> +// { dg-final { scan-tree-dump-times "= ASAN_POISON \\(\\)" 1 "asan1" } }
>  // { dg-output "ERROR: AddressSanitizer: stack-use-after-scope on 
> address.*(\n|\r\n|\r)" }
>  // { dg-output "READ of size .*" }
>  // { dg-output ".*'a' <== Memory access at offset \[0-9\]* is inside this 
> variable.*" }

This is PASS for most of all tortute test options, but for "-O2 -flto
-fuse-linker-plugin -fno-fat-lto-objects" will produce:

    PASS: gcc.dg/asan/use-after-scope-9.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  (test for excess errors)
    PASS: gcc.dg/asan/use-after-scope-9.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
    PASS: gcc.dg/asan/use-after-scope-9.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  output pattern test, ERROR: AddressSanitizer: 
stack-use-after-scope on address.*(
    |
    |^M)READ of size .*.*'a' <== Memory access at offset [0-9]* is inside this 
variable.*
    {+UNRESOLVED: gcc.dg/asan/use-after-scope-9.c   -O2 -flto 
-fuse-linker-plugin -fno-fat-lto-objects   scan-tree-dump-times asan1 "= 
ASAN_POISON \\(\\)" 1+}

(Notice UNRESOLVED.)  Is this to be expected/skipped/fixed?


Grüße
 Thomas

Reply via email to