OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [wtr-suffix-1.c] - Blame information for rev 853

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test for -Wtraditional warnings on integer constant suffixes.
2
   Note, gcc should omit these warnings in system header files.
3
   Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/24/2000.  */
4
/* { dg-do compile } */
5
/* { dg-options "-Wtraditional" } */
6
 
7
void
8
testfunc ()
9
{
10
  int i;
11
  double f;
12
 
13
  i = 1L;
14
  i = 1l;
15
  i = 1U; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
16
  i = 1u; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
17
  f = 1.0;
18
  f = 1.0F; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
19
  f = 1.0f; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
20
  f = 1.0L; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
21
  f = 1.0l; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
22
 
23
# 24 "sys-header.h" 3
24
/* We are in system headers now, no -Wtraditional warnings should issue.  */
25
 
26
  i = 1L;
27
  i = 1l;
28
  i = 1U;
29
  i = 1u;
30
  f = 1.0;
31
  f = 1.0F;
32
  f = 1.0f;
33
  f = 1.0L;
34
  f = 1.0l;
35
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.