2 /* { dg-options "-fsanitize=bool,enum" } */
7 enum A
{ B
= -3, C
= 2 } a
;
10 __attribute__((noinline
, noclone
)) enum A
13 *p
= b
; /* { dg-output "load-bool-enum.c:13:\[^\n\r]*runtime error: load of value 4, which is not a valid value for type '(_B|b)ool'(\n|\r\n|\r)" } */
14 return a
; /* { dg-output "\[^\n\r]*load-bool-enum.c:14:\[^\n\r]*runtime error: load of value 9, which is not a valid value for type 'A'(\n|\r\n|\r)" { target c++ } } */
22 if (sizeof (int) != sizeof (a
) || sizeof (b
) != 1)
24 __builtin_memcpy (&a
, &d
, sizeof (int));
25 __builtin_memcpy (&b
, &c
, 1);