summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-02-11 19:36:25 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-02-11 19:36:25 +0000
commit8a8d8df41bd19bca445e2302172534f46d418b27 (patch)
tree36365726b7a73c04a0a6732609ea4dfae8b98bcf /gcc/testsuite
parent3cc4218a4239d4c95cdcbb19082c73a5b125f4aa (diff)
downloadgcc-8a8d8df41bd19bca445e2302172534f46d418b27.tar.gz
* gcc.c-torture/compile/20000211-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31930 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20000211-1.c98
2 files changed, 102 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index eca8f2520fa..3a78d3b5c5b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+Fri Feb 11 12:35:40 2000 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/compile/20000211-1.c: New test.
+
2000-02-09 Jonathan Larmour <jlarmour@redhat.co.uk>
* gcc.dg/special/ecos.exp: Use -static when testing --gc-sections
diff --git a/gcc/testsuite/gcc.c-torture/compile/20000211-1.c b/gcc/testsuite/gcc.c-torture/compile/20000211-1.c
new file mode 100644
index 00000000000..8d8a4074e0f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20000211-1.c
@@ -0,0 +1,98 @@
+typedef long unsigned int size_t;
+typedef unsigned char Bufbyte;
+typedef int Bytecount;
+typedef int Charcount;
+typedef struct lstream Lstream;
+typedef int Lisp_Object;
+extern Lisp_Object Qnil;
+extern inline int
+TRUE_LIST_P (Lisp_Object object)
+{
+ return (( object ) == ( Qnil )) ;
+}
+struct Lisp_String
+{
+ Bytecount _size;
+ Bufbyte *_data;
+};
+typedef enum lstream_buffering
+{
+ LSTREAM_LINE_BUFFERED,
+} Lstream_buffering;
+struct lstream
+{
+ Lstream_buffering buffering;
+ unsigned char *out_buffer;
+ size_t out_buffer_size;
+ size_t out_buffer_ind;
+ size_t byte_count;
+ long flags;
+ char data[1];
+};
+typedef struct printf_spec printf_spec;
+struct printf_spec
+{
+};
+typedef union printf_arg printf_arg;
+union printf_arg
+{
+};
+typedef struct
+{
+ int cur;
+} printf_spec_dynarr;
+typedef struct
+{
+} printf_arg_dynarr;
+static void
+doprnt_1 (Lisp_Object stream, const Bufbyte *string, Bytecount len,
+ Charcount minlen, Charcount maxlen, int minus_flag, int zero_flag)
+{
+ Charcount cclen;
+ Bufbyte pad;
+ Lstream *lstr = (( struct lstream *) ((void *)(((( stream ) & ((1UL << ((4 * 8 ) - 4 ) ) - 1UL) ) ) | 0x40000000 )) ) ;
+ cclen = ( len ) ;
+ if (zero_flag)
+ pad = '0';
+ pad = ' ';
+#if 0
+ if (minlen > cclen && !minus_flag)
+#endif
+ {
+ int to_add = minlen - cclen;
+ while (to_add > 0)
+ {
+ (( lstr )->out_buffer_ind >= ( lstr )->out_buffer_size ? Lstream_fputc ( lstr , pad ) : (( lstr )->out_buffer[( lstr )->out_buffer_ind++] = (unsigned char) ( pad ), ( lstr )->byte_count++, ( lstr )->buffering == LSTREAM_LINE_BUFFERED && ( lstr )->out_buffer[( lstr )->out_buffer_ind - 1] == '\n' ? Lstream_flush_out ( lstr ) : 0)) ;
+ to_add--;
+ }
+ }
+ if (maxlen >= 0)
+ len = ( ((( maxlen ) <= ( cclen )) ? ( maxlen ) : ( cclen )) ) ;
+ Lstream_write (lstr, string, len);
+ if (minlen > cclen && minus_flag)
+ {
+ int to_add = minlen - cclen;
+ while (to_add > 0)
+ {
+ (( lstr )->out_buffer_ind >= ( lstr )->out_buffer_size ? Lstream_fputc ( lstr , pad ) : (( lstr )->out_buffer[( lstr )->out_buffer_ind++] = (unsigned char) ( pad ), ( lstr )->byte_count++, ( lstr )->buffering == LSTREAM_LINE_BUFFERED && ( lstr )->out_buffer[( lstr )->out_buffer_ind - 1] == '\n' ? Lstream_flush_out ( lstr ) : 0)) ;
+ to_add--;
+ }
+ }
+}
+static Bytecount
+emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc,
+ Lisp_Object format_reloc, Bytecount format_length,
+ int nargs,
+ const Lisp_Object *largs)
+{
+ int i;
+ printf_spec_dynarr *specs = 0;
+ format_nonreloc = (( (( struct Lisp_String *) ((void *)(((( format_reloc ) & ((1UL << ((4 * 8 ) - 4 ) ) - 1UL) ) ) | 0x40000000 )) ) )->_data + 0) ;
+ format_length = (( (( struct Lisp_String *) ((void *)(((( format_reloc ) & ((1UL << ((4 * 8 ) - 4 ) ) - 1UL) ) ) | 0x40000000 )) ) )->_size) ;
+ specs = parse_doprnt_spec (format_nonreloc, format_length);
+ for (i = 0; i < (( specs )->cur) ; i++)
+ {
+ char ch;
+ doprnt_1 (stream, (Bufbyte *) &ch, 1, 0, -1, 0, 0);
+ }
+}