testsuite: Skip failing analyzer tests on AIX.
[official-gcc.git] / gcc / testsuite / gcc.dg / analyzer / out-of-bounds-diagram-7.c
blob5e3f9a74d319f46cc44141f2219b98228038ad2f
1 /* { dg-additional-options "-fdiagnostics-text-art-charset=unicode" } */
2 /* { dg-skip-if "" { powerpc-ibm-aix* } } */
4 #include <string.h>
6 void
7 test_string_with_control_chars ()
9 char buf[8];
10 strcpy (buf, "\tone\n\ttwo\n"); /* { dg-warning "stack-based buffer overflow" } */
11 /* { dg-warning "'__builtin_memcpy' writing 11 bytes into a region of size 8 overflows the destination" "" { target *-*-* } .-1 } */
14 /* { dg-begin-multiline-output "" }
16 ┌──────┬──────┬──────┬─────┬─────┬─────┬─────┬─────┐┌─────┬─────┬──────┐
17 │ [0] │ [1] │ [2] │ [3] │ [4] │ [5] │ [6] │ [7] ││ [8] │ [9] │ [10] │
18 ├──────┼──────┼──────┼─────┼─────┼─────┼─────┼─────┤├─────┼─────┼──────┤
19 │ 0x09 │ 'o' │ 'n' │ 'e' │0x0a │0x09 │ 't' │ 'w' ││ 'o' │0x0a │ NUL │
20 ├──────┴──────┴──────┴─────┴─────┴─────┴─────┴─────┴┴─────┴─────┴──────┤
21 │ string literal (type: 'char[11]') │
22 └──────────────────────────────────────────────────────────────────────┘
23 │ │ │ │ │ │ │ │ │ │ │
24 │ │ │ │ │ │ │ │ │ │ │
25 v v v v v v v v v v v
26 ┌──────┬─────────────────────────────────────┬─────┐┌──────────────────┐
27 │ [0] │ ... │ [7] ││ │
28 ├──────┴─────────────────────────────────────┴─────┤│after valid range │
29 │ 'buf' (type: 'char[8]') ││ │
30 └──────────────────────────────────────────────────┘└──────────────────┘
31 ├────────────────────────┬─────────────────────────┤├────────┬─────────┤
32 │ │
33 ╭────────┴────────╮ ╭─────────┴─────────╮
34 │capacity: 8 bytes│ │overflow of 3 bytes│
35 ╰─────────────────╯ ╰───────────────────╯
37 { dg-end-multiline-output "" } */