aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/asm-hard-reg-error-5.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/asm-hard-reg-error-5.c')
-rw-r--r--gcc/testsuite/gcc.dg/asm-hard-reg-error-5.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/asm-hard-reg-error-5.c b/gcc/testsuite/gcc.dg/asm-hard-reg-error-5.c
new file mode 100644
index 0000000..85398f0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/asm-hard-reg-error-5.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+/* Test clobbers.
+ See asm-hard-reg-error-{2,3}.c for tests involving register pairs. */
+
+int
+test (void)
+{
+ int x, y;
+ __asm__ ("" : "={0}" (x), "={1}" (y) : : "1"); /* { dg-error "hard register constraint for output 1 conflicts with 'asm' clobber list" } */
+ __asm__ ("" : "={0}" (x) : "{0}" (y), "{1}" (y) : "1"); /* { dg-error "hard register constraint for input 1 conflicts with 'asm' clobber list" } */
+ return x + y;
+}