OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.ext/] [attrib4.C] - Diff between revs 305 and 338

Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do assemble  }
// { dg-do assemble  }
// { dg-options "-Wformat" }
// { dg-options "-Wformat" }
// Test that attributes are really applied to function declarations under
// Test that attributes are really applied to function declarations under
// various conditions.
// various conditions.
// Contributed by Jason Merrill (jason@cygnus.com)
// Contributed by Jason Merrill (jason@cygnus.com)
#define PF __attribute__ ((format (printf, 1, 2)))
#define PF __attribute__ ((format (printf, 1, 2)))
struct A {
struct A {
  static PF void f (const char *, ...);
  static PF void f (const char *, ...);
  static PF void g (const char *, ...) { }
  static PF void g (const char *, ...) { }
  static void test ();
  static void test ();
};
};
void PF h (const char *, ...);
void PF h (const char *, ...);
void PF k (const char *, ...) { }
void PF k (const char *, ...) { }
void A::test ()
void A::test ()
{
{
  f ("%f", 42);                 // { dg-warning "argument 2" }
  f ("%f", 42);                 // { dg-warning "argument 2" }
  g ("%f", 42);                 // { dg-warning "argument 2" }
  g ("%f", 42);                 // { dg-warning "argument 2" }
  h ("%f", 42);                 // { dg-warning "argument 2" }
  h ("%f", 42);                 // { dg-warning "argument 2" }
  k ("%f", 42);                 // { dg-warning "argument 2" }
  k ("%f", 42);                 // { dg-warning "argument 2" }
}
}
 
 

powered by: WebSVN 2.1.0

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