summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/format/ms_unnamed-1.c
blob: ac1294282908e7f079273a6e591e0a82730446ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Test for warnings with possibly unnamed integer types.  Bug 24329.  */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do compile { target { *-*-mingw* } } } */
/* { dg-options "-Wformat" } */
/* { dg-options "-Wformat -msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */

#define USE_SYSTEM_FORMATS
#include "format.h"

/* Definition of TItype follows same logic as in gcc.dg/titype-1.c,
   but must be a #define to avoid giving the type a name.  */
#if (defined(__LP64__) && !defined(__hppa__)) || defined(__SPU__)
#define TItype int __attribute__ ((mode (TI)))
#else
#define TItype long
#endif

void
f (TItype x)
{
  printf("%d", x); /* { dg-warning "expects argument" } */
  printf("%d", 141592653589793238462643383279502884197169399375105820974944); /* { dg-warning "expects argument" } */
  /* { dg-warning "unsigned only|too large" "constant" { target *-*-* } 23 } */
}