]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Fri, 14 Mar 2003 14:59:34 +0000 (14:59 +0000)
committerNo Author <no-author@gcc.gnu.org>
Fri, 14 Mar 2003 14:59:34 +0000 (14:59 +0000)
'gcc-3_2-branch'.

From-SVN: r64361

gcc/testsuite/gcc.c-torture/compile/20030314-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/20030224-2.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.c-torture/compile/20030314-1.c b/gcc/testsuite/gcc.c-torture/compile/20030314-1.c
new file mode 100644 (file)
index 0000000..02d4fed
--- /dev/null
@@ -0,0 +1,18 @@
+/* PR optimization/8396 */
+/* Originator: <papadopo@shfj.cea.fr> */
+
+/* Verify that the tree inliner doesn't mess up the types
+   when passing the value of read-only constant arguments.  */
+
+static inline bar(const short int xs, const short int xe)
+{
+  if (xe && (xs < xe))
+    ;
+}
+  
+void f()
+{
+  short int xe;
+
+  bar(0, xe);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030224-2.c b/gcc/testsuite/gcc.c-torture/execute/20030224-2.c
new file mode 100644 (file)
index 0000000..5b692fb
--- /dev/null
@@ -0,0 +1,28 @@
+/* Make sure that we don't free any temp stack slots associated with
+   initializing marker before we're finished with them.  */
+
+extern void abort();
+
+typedef struct { short v16; } __attribute__((packed)) jint16_t;
+
+struct node {
+  jint16_t magic;
+  jint16_t nodetype;
+  int totlen;
+} __attribute__((packed));
+
+struct node node, *node_p = &node;
+
+int main()
+{
+  struct node marker = {
+    .magic = (jint16_t) {0x1985},
+    .nodetype = (jint16_t) {0x2003},
+    .totlen = node_p->totlen
+  };
+  if (marker.magic.v16 != 0x1985)
+    abort();
+  if (marker.nodetype.v16 != 0x2003)
+    abort();
+  return 0;
+}