* auto-profile.c (afdo_annotate_cfg): Use update_max_bb_count.
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / vaarg3.C
blobc14a4db4ccc85a6b92dc9d9a41b1c5259fd4d1c9
1 // { dg-do assemble  }
2 // { dg-options "-Wconditionally-supported" }
3 // { dg-options "-Wno-abi -Wconditionally-supported" { target arm_eabi } }
5 // Copyright (C) 1999 Free Software Foundation, Inc.
6 // Contributed by Nathan Sidwell 4 Oct 1999 <nathan@acm.org>
8 // Make sure we diagnose bad uses of va_arg
10 #include <stdarg.h>
12 struct X {int m;};
13 struct Y { Y(const Y&); };
14 struct Z;   // { dg-message "forward decl" }
15 void fn1(va_list args)
17   int i = va_arg (args, int);
18   Y x = va_arg (args, Y);         // { dg-message "receiv" }
19   Y y = va_arg (args, struct Y);  // { dg-message "receiv" }
20   int &r = va_arg (args, int &);  // { dg-error "cannot receive" }
21   
22   Z z1 = va_arg (args, Z);        // { dg-error "incomplete" } 
23   const Z &z2 = va_arg (args, Z);       // { dg-error "incomplete" } 
25   va_arg (args, char);    // { dg-warning "promote" } 
26   // { dg-message "should pass" "pass" { target *-*-* } .-1 }
27   // { dg-message "abort" "abort" { target *-*-* } .-2 }
28   va_arg (args, int []);  // { dg-error "array with unspecified bounds" } promote
29   va_arg (args, int ());  // { dg-warning "promoted" } promote
30   // { dg-message "abort" "abort" { target *-*-* } .-1 }
31   va_arg (args, bool);    // { dg-warning "promote" "promote" } 
32   // { dg-message "abort" "abort" { target *-*-* } .-1 }