view gcc/testsuite/c-c++-common/pr68833-1.c @ 16:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
line wrap: on
line source

/* PR c/68833 */
/* { dg-do compile } */
/* { dg-options "-Werror=larger-than-65536 -Werror=format -Werror=missing-noreturn" } */
/* { dg-require-effective-target int32plus } */

int a[131072];	/* { dg-error "size of 'a' is \[1-9]\[0-9]* bytes" } */
int b[1024];	/* { dg-bogus "size of 'b' is \[1-9]\[0-9]* bytes" } */

void
f1 (const char *fmt)
{
  __builtin_printf ("%d\n", 1.2);	/* { dg-error "expects argument of type" } */
  __builtin_printf (fmt, 1.2);		/* { dg-bogus "format not a string literal, argument types not checked" } */
}

extern void f2 (void);
void
f2 (void) /* { dg-error "candidate for attribute 'noreturn'" "detect noreturn candidate" } */
{
  __builtin_exit (0);
}

/* { dg-prune-output "treated as errors" } */