summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-26 15:53:14 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-26 15:53:14 +0000
commit16d4da86ad326a997d75ae7a4713f4f250964883 (patch)
tree2004ca3e22c09d34da7b9b5d3effeba065873fd5 /gcc/testsuite
parent86b042fab4995bfbcc294b9f12bc6450c7e1245b (diff)
downloadgcc-16d4da86ad326a997d75ae7a4713f4f250964883.tar.gz
PR inline-asm/11676
* cse.c (count_reg_usage): Handle asm_operands properly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69816 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gcc.dg/asm-8.c9
-rw-r--r--gcc/testsuite/gcc.dg/i386-asm-1.c24
2 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/asm-8.c b/gcc/testsuite/gcc.dg/asm-8.c
new file mode 100644
index 00000000000..a3f3962eb16
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/asm-8.c
@@ -0,0 +1,9 @@
+/* PR inline-asm/11676 */
+/* { dg-do compile } */
+/* { dg-options "-O -Wall" } */
+
+void foo(void)
+{
+ long x = 0;
+ asm volatile ("" : "=r"(x) : "r"(x)); /* { dg-bogus "uninitialized" } */
+}
diff --git a/gcc/testsuite/gcc.dg/i386-asm-1.c b/gcc/testsuite/gcc.dg/i386-asm-1.c
new file mode 100644
index 00000000000..aae0de845b3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/i386-asm-1.c
@@ -0,0 +1,24 @@
+/* PR inline-asm/11676 */
+/* { dg-do run { target i?86-*-* } } */
+/* { dg-options "-O2" } */
+
+static int bar(int x) __asm__("bar");
+static int __attribute__((regparm(1), noinline, used))
+bar(int x)
+{
+ if (x != 0)
+ abort ();
+}
+
+static int __attribute__((regparm(1), noinline))
+foo(int x)
+{
+ x = 0;
+ __asm__ __volatile__("call bar" : "=a"(x) : "a"(x));
+}
+
+int main()
+{
+ foo(1);
+ return 0;
+}