diff mbox

Testcase for the recent vt_expand_*loc max depth change

Message ID 20100720161806.GD19172@tyan-ft48-01.lab.bos.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek July 20, 2010, 4:18 p.m. UTC
Hi!

Here is a testcase that failed before the var-tracking.c fix from today and
succeeds now (tested on x86_64-linux and i686-linux).  Ok for trunk?

2010-07-20  Jakub Jelinek  <jakub@redhat.com>

	* gcc.dg/guality/asm-1.c: New test.


	Jakub

Comments

Richard Biener July 21, 2010, 8:09 a.m. UTC | #1
On Tue, 20 Jul 2010, Jakub Jelinek wrote:

> Hi!
> 
> Here is a testcase that failed before the var-tracking.c fix from today and
> succeeds now (tested on x86_64-linux and i686-linux).  Ok for trunk?

Ok.

Thanks,
Richard.

> 2010-07-20  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* gcc.dg/guality/asm-1.c: New test.
> 
> --- gcc/testsuite/gcc.dg/guality/asm-1.c.jj	2010-07-20 16:42:34.000000000 +0200
> +++ gcc/testsuite/gcc.dg/guality/asm-1.c	2010-07-20 16:49:09.000000000 +0200
> @@ -0,0 +1,25 @@
> +/* { dg-do run } */
> +/* { dg-options "-g" } */
> +
> +struct A { int x; unsigned short y; char z[64]; };
> +
> +void __attribute__((noinline))
> +foo (struct A *p, char *q)
> +{
> +  int f = &p->z[p->y] - q;
> +  asm volatile ("nop");
> +  asm volatile ("nop" : : "g" (f));		/* { dg-final { gdb-test 12 "f" "14" } } */
> +  asm volatile ("" : : "g" (p), "g" (q));
> +}
> +
> +int
> +main ()
> +{
> +  struct A a;
> +  __builtin_memset (&a, 0, sizeof a);
> +  a.y = 26;
> +  a.x = 12;
> +  asm volatile ("" : : "r" (&a) : "memory");
> +  foo (&a, &a.z[a.x]);
> +  return 0;
> +}
> 
> 	Jakub
> 
>
diff mbox

Patch

--- gcc/testsuite/gcc.dg/guality/asm-1.c.jj	2010-07-20 16:42:34.000000000 +0200
+++ gcc/testsuite/gcc.dg/guality/asm-1.c	2010-07-20 16:49:09.000000000 +0200
@@ -0,0 +1,25 @@ 
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+struct A { int x; unsigned short y; char z[64]; };
+
+void __attribute__((noinline))
+foo (struct A *p, char *q)
+{
+  int f = &p->z[p->y] - q;
+  asm volatile ("nop");
+  asm volatile ("nop" : : "g" (f));		/* { dg-final { gdb-test 12 "f" "14" } } */
+  asm volatile ("" : : "g" (p), "g" (q));
+}
+
+int
+main ()
+{
+  struct A a;
+  __builtin_memset (&a, 0, sizeof a);
+  a.y = 26;
+  a.x = 12;
+  asm volatile ("" : : "r" (&a) : "memory");
+  foo (&a, &a.z[a.x]);
+  return 0;
+}