summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/compat
diff options
context:
space:
mode:
authordannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-25 07:34:52 +0000
committerdannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-25 07:34:52 +0000
commit67c832f19a478bcae6b28c934624c960d419659a (patch)
treedf6cbbe388aa51cdeb91b1d1197c088b2e60d094 /gcc/testsuite/g++.dg/compat
parenta3d8cd7b83bdb88796665104bd375acfea8d2fa1 (diff)
downloadgcc-67c832f19a478bcae6b28c934624c960d419659a.tar.gz
* gcc.dg/compat/struct-layout-1_generate.c (COMPAT_PRLL):
Define and use throughout as long long printf format specifier. * g++.dg/compat/struct-layout-1_generate.c (COMPAT_PRLL): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126903 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/compat')
-rw-r--r--gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c b/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
index 4234e9f3dc3..49608f9481c 100644
--- a/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
+++ b/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
@@ -36,6 +36,12 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
# error Need 64-bit long long
#endif
+#if defined __MSVCRT__
+#define COMPAT_PRLL "I64"
+#else
+#define COMPAT_PRLL "ll"
+#endif
+
typedef unsigned int hashval_t;
enum TYPE
@@ -778,7 +784,7 @@ output_FNB (char mode, struct entry *e)
m &= e->len > 1 ? (1ULL << (e->len - 1)) - 1 : 1;
l1 &= m;
l2 &= m;
- fprintf (outfile, "%s%llu%s,%s%llu%s",
+ fprintf (outfile, "%s%" COMPAT_PRLL "u%s,%s%" COMPAT_PRLL "u%s",
(signs & 1) ? "-" : "", l1, l1 > 2147483647 ? "LL" : "",
(signs & 2) ? "-" : "", l2, l2 > 2147483647 ? "LL" : "");
break;
@@ -788,7 +794,8 @@ output_FNB (char mode, struct entry *e)
m &= (1ULL << e->len) - 1;
l1 &= m;
l2 &= m;
- fprintf (outfile, "%lluU%s,%lluU%s", l1, l1 > 4294967295U ? "LL" : "",
+ fprintf (outfile,"%" COMPAT_PRLL "uU%s,%" COMPAT_PRLL "uU%s",
+ l1, l1 > 4294967295U ? "LL" : "",
l2, l2 > 4294967295U ? "LL" : "");
break;
case TYPE_FLOAT:
@@ -802,7 +809,8 @@ output_FNB (char mode, struct entry *e)
if (e->type->maxval == 0)
fputs ("e0_0,e0_0", outfile);
else if (e->type->maxval == 1)
- fprintf (outfile, "e1_%lld,e1_%lld", l1 & 1, l2 & 1);
+ fprintf (outfile, "e1_%" COMPAT_PRLL "d,e1_%" COMPAT_PRLL "d",
+ l1 & 1, l2 & 1);
else
{
p = strchr (e->type->name, '\0');
@@ -814,7 +822,8 @@ output_FNB (char mode, struct entry *e)
l1 += e->type->maxval - 6;
if (l2 > 3)
l2 += e->type->maxval - 6;
- fprintf (outfile, "e%s_%lld,e%s_%lld", p, l1, p, l2);
+ fprintf (outfile, "e%s_%" COMPAT_PRLL "d,e%s_%" COMPAT_PRLL "d",
+ p, l1, p, l2);
}
break;
case TYPE_SENUM:
@@ -823,7 +832,7 @@ output_FNB (char mode, struct entry *e)
p++;
l1 %= 7;
l2 %= 7;
- fprintf (outfile, "e%s_%s%lld,e%s_%s%lld",
+ fprintf (outfile, "e%s_%s%" COMPAT_PRLL "d,e%s_%s%" COMPAT_PRLL "d",
p, l1 < 3 ? "m" : "",
l1 == 3 ? 0LL : e->type->maxval - (l1 & 3),
p, l2 < 3 ? "m" : "",
@@ -832,13 +841,15 @@ output_FNB (char mode, struct entry *e)
case TYPE_PTR:
l1 %= 256;
l2 %= 256;
- fprintf (outfile, "(%s)&intarray[%lld],(%s)&intarray[%lld]",
+ fprintf (outfile,
+ "(%s)&intarray[%" COMPAT_PRLL "d], (%s)&intarray[%" COMPAT_PRLL "d]",
e->type->name, l1, e->type->name, l2);
break;
case TYPE_FNPTR:
l1 %= 10;
l2 %= 10;
- fprintf (outfile, "fn%lld,fn%lld", l1, l2);
+ fprintf (outfile,
+ "fn%" COMPAT_PRLL "d,fn%" COMPAT_PRLL "d", l1, l2);
break;
default:
abort ();