3 // Copyright (C) 1999 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 21 Nov 1999 <nathan@acm.org>
6 // make sure we only warn on assigning a negative (signed) value
7 // to an unsigned type, and don't warn just if the unsigned value
8 // happens to have the top bit set.
18 unsigned volatile s3 = -1u;
19 unsigned const s4 = -1u;
20 unsigned const &s5(-1u);
38 unsigned s1 = -1; // { dg-warning "" } initialization
39 unsigned s2(-1); // { dg-warning "" } initialization
40 unsigned volatile s3 = -1;// { dg-warning "" } initialization
41 unsigned const s4 = -1; // { dg-warning "" } initialization
42 unsigned const &s5(-1); // { dg-warning "" } initialization
43 s1 = -1; // { dg-warning "" } assignment
44 fn (-1); // { dg-warning "" } passing
51 unsigned volatile s3 = -(-1);
52 unsigned const s4 = -(-1);
53 unsigned const &s5(-(-1));
62 unsigned volatile s3 = -0;
63 unsigned const s4 = -0;
64 unsigned const &s5(-0);