Test for optimizer bug with -finline-functions.
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Nov 1999 03:22:35 +0000 (03:22 +0000)
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Nov 1999 03:22:35 +0000 (03:22 +0000)
Reported by Jim Meyering; distilled from bash.

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

gcc/testsuite/gcc.c-torture/execute/991112-1.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.c-torture/execute/991112-1.c b/gcc/testsuite/gcc.c-torture/execute/991112-1.c
new file mode 100644 (file)
index 0000000..78c1a5e
--- /dev/null
@@ -0,0 +1,19 @@
+/* This code was miscompiled at -O3 on x86.
+   Reported by Jim Myering; distilled from bash.  */
+
+int rl_show_char (int c) { return 0; }
+
+int rl_character_len (int c, int pos)
+{
+  return isprint (c) ? 1 : 2;
+}
+
+int main(void)
+{
+  int (*x)(int, int) = rl_character_len;
+  if (x('a', 1) != 1)
+    abort();
+  if (x('\002', 1) != 2)
+    abort();
+  return 0;
+}