2 /* { dg-set-target-env-var ASAN_OPTIONS "detect_stack_use_after_return=1" } */
3 /* { dg-shouldfail "asan" } */
16 __attribute__((noinline
))
17 char *Ident(char *x
) {
18 fprintf(stderr
, "1: %p\n", x
);
22 __attribute__((noinline
))
28 __attribute__((noinline
))
30 fprintf(stderr
, "2: %p\n", x
);
34 void *Thread(void *unused
) {
39 int main(int argc
, char **argv
) {
42 pthread_create(&t
, 0, Thread
, 0);
50 /* { dg-output "WRITE of size 1 at .* thread T0.*" } */
51 /* { dg-output " #0.*(Func2)?.*use-after-return-1.(c:31)?.*" } */
52 /* { dg-output "is located in stack of thread T0 at offset.*" } */
53 /* { dg-output "\'local\' \\(line 24\\) <== Memory access at offset 32 is inside this variable" } */