Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/ubsan/vla-1.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do run } |
145 | 2 // { dg-options "-Wno-vla -Wno-stringop-overflow -fsanitize=undefined" } |
111 | 3 // { dg-output "index 1 out of bounds" } |
4 | |
145 | 5 void f(int i) |
6 { | |
7 /* The following creates an array of char[4] on the stack and | |
8 the initialization triggers a -Wstringop-overflow with LTO | |
9 (or when the function is inlined into the called, such as | |
10 with -fwhole-program). See PR91258. The warning is | |
11 suppressed above. */ | |
111 | 12 int ar[i] = { 42, 24 }; |
13 } | |
14 | |
15 int main() | |
16 { | |
17 f(1); | |
18 } |