annotate gcc/testsuite/gcc.dg/pr80020.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR middle-end/80020 - gcc confused about aligned_alloc argument order
kono
parents:
diff changeset
2 { dg-do compile }
kono
parents:
diff changeset
3 { dg-options "-O2 -Wall -fdump-tree-optimized" } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 void sink (void*);
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 void foo (void)
kono
parents:
diff changeset
8 {
kono
parents:
diff changeset
9 enum {
kono
parents:
diff changeset
10 Align = 32,
kono
parents:
diff changeset
11 Size = 123
kono
parents:
diff changeset
12 };
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 void *p = __builtin_aligned_alloc (Align, Size);
kono
parents:
diff changeset
15 unsigned n = __builtin_object_size (p, 0);
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 if (n != Size)
kono
parents:
diff changeset
18 __builtin_abort ();
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 __builtin___memset_chk (p, 0, Size, n);
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 sink (p);
kono
parents:
diff changeset
23 }
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 /* { dg-final { scan-tree-dump-not "abort" "optimized" } }
kono
parents:
diff changeset
26 { dg-final { scan-tree-dump-not "memset_chk" "optimized" } } */