OSDN Git Service

2010-04-23 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Apr 2010 15:32:22 +0000 (15:32 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Apr 2010 15:32:22 +0000 (15:32 +0000)
PR lto/41734
* gcc.dg/lto/20100423-2_0.c: New testcase.
* gcc.dg/lto/20100423-2_0.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158670 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/20100423-2_0.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/20100423-2_1.c [new file with mode: 0644]

index 28b1201..dacc10e 100644 (file)
@@ -1,5 +1,11 @@
 2010-04-23  Richard Guenther  <rguenther@suse.de>
 
+       PR lto/41734
+       * gcc.dg/lto/20100423-2_0.c: New testcase.
+       * gcc.dg/lto/20100423-2_0.c: Likewise.
+
+2010-04-23  Richard Guenther  <rguenther@suse.de>
+
        PR lto/43455
        * gcc.dg/lto/20100423-1_0.c: New testcase.
        * gcc.dg/lto/20100423-1_1.c: Likewise.
diff --git a/gcc/testsuite/gcc.dg/lto/20100423-2_0.c b/gcc/testsuite/gcc.dg/lto/20100423-2_0.c
new file mode 100644 (file)
index 0000000..4f98da4
--- /dev/null
@@ -0,0 +1,25 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O2 -flto} {-O2 -fwhopr} {-O3 -flto} {-O3 -fwhopr}} } */
+
+typedef unsigned int size_t;
+extern struct _IO_FILE *stderr;
+typedef unsigned char uch;
+extern uch inbuf[];
+unsigned insize;
+char *progname;
+extern void read_error (void);
+int fill_inbuf(int eof_ok)
+{
+  if (insize == 0) 
+    {
+      if (eof_ok)
+        return -1;
+      read_error();
+    }
+  return inbuf[0];
+}
+void read_error(void)
+{
+  __builtin_fprintf(stderr, "\n%s: ", progname);
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20100423-2_1.c b/gcc/testsuite/gcc.dg/lto/20100423-2_1.c
new file mode 100644 (file)
index 0000000..546de65
--- /dev/null
@@ -0,0 +1,20 @@
+typedef unsigned char uch;
+uch inbuf[8];
+extern unsigned insize;
+unsigned inptr; 
+int to_stdout = 0;
+int force = 0;
+extern int fill_inbuf (int);
+int get_method(int in)
+{
+  char magic[2];
+  if (force && to_stdout)
+    magic[0] = (char)(inptr < insize ? inbuf[inptr++] : fill_inbuf(1));
+  else
+    magic[1] = (char)(inptr < insize ? inbuf[inptr++] : fill_inbuf(0));
+}
+int main()
+{
+  return 0;
+}
+