Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / c-c++-common / asan / alloca_overflow_partial.c
blob52282411bf5e2fd8bbd711ab81ab1bbb2354b8e3
1 /* { dg-do run } */
2 /* { dg-shouldfail "asan" } */
4 #include <assert.h>
6 volatile const int ten = 10;
8 __attribute__((noinline)) void foo(int index, int len) {
9 volatile char str[len] __attribute__((aligned(32)));
10 assert(!((long) str & 31L));
11 str[index] = '1'; // BOOM
14 int main(int argc, char **argv) {
15 foo(ten, ten);
16 return 0;
19 /* { dg-output "WRITE of size 1 at 0x\[0-9a-f\]+ thread T0\[^\n\r]*(\n|\r\n|\r)" } */
20 /* { dg-output " #0 0x\[0-9a-f\]+ +(in _*foo(\[^\n\r]*alloca_overflow_partial.c:11|\[^\n\r]*:0|\[^\n\r]*\\+0x\[0-9a-z\]*)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
21 /* { dg-output "\[^\n\r]*Address 0x\[0-9a-f\]+ is located in stack of thread T0.*(\n|\r\n|\r)" */
22 /* { dg-output "\[^\n\r]*in foo.*alloca_overflow_partial.c.*(\n|\r\n|\r)" */