aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorMark Mitchell <mmitchel@gcc.gnu.org>2007-07-27 17:13:29 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2007-07-27 17:13:29 +0000
commit83144bd60ce827e50425094f47f39aed75324cd6 (patch)
tree8699cc4407ba2a4a6d5b61ba61f8dcc7daeccc44 /gcc/testsuite
parentb8475dd604f7461fef93b0fe2b9c52b4a6d206f0 (diff)
downloadgcc-83144bd60ce827e50425094f47f39aed75324cd6.zip
gcc-83144bd60ce827e50425094f47f39aed75324cd6.tar.gz
gcc-83144bd60ce827e50425094f47f39aed75324cd6.tar.bz2
re PR c++/32346 (long long bitfield passed to int argument incorrectly)
PR c++/32346 * call.c (convert_for_arg_passing): Only widen bitfields to their declared types if necessary. PR c++/32346 * g++.dg/expr/bitfield9.C: New test. From-SVN: r126986
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/g++.dg/expr/bitfield9.C25
2 files changed, 31 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index cc8cfc2..7649406 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-07-27 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/32346
+ * g++.dg/expr/bitfield9.C: New test.
+
2007-07-26 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/32899
@@ -22,7 +27,7 @@
* gcc.target/mips/ins-1.c: New test.
-2007-07-26 Nathan Froyd <froydnj@codesourcery.com>
+'2007-07-26 Nathan Froyd <froydnj@codesourcery.com>
PR/19232
* gcc.dg/assign-warn-3.c (f0): Declare as inline.
diff --git a/gcc/testsuite/g++.dg/expr/bitfield9.C b/gcc/testsuite/g++.dg/expr/bitfield9.C
new file mode 100644
index 0000000..047b1bf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/bitfield9.C
@@ -0,0 +1,25 @@
+// PR c++/32346
+// { dg-do run }
+
+extern "C" void abort();
+
+struct S {
+ long long i : 32;
+};
+
+void f(int i, int j) {
+ if (i != 0xabcdef01)
+ abort();
+ if (j != 0)
+ abort();
+}
+
+void g(S s) {
+ f(s.i, 0);
+}
+
+int main() {
+ S s;
+ s.i = 0xabcdef01;
+ g(s);
+}