summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/c-c++-common')
-rw-r--r--gcc/testsuite/c-c++-common/pr51768.c25
-rw-r--r--gcc/testsuite/c-c++-common/tm/memcpy-1.c6
2 files changed, 30 insertions, 1 deletions
diff --git a/gcc/testsuite/c-c++-common/pr51768.c b/gcc/testsuite/c-c++-common/pr51768.c
new file mode 100644
index 00000000000..082594ccad7
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr51768.c
@@ -0,0 +1,25 @@
+/* PR middle-end/51768 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+foo (void)
+{
+ asm goto ("" : : : : lab, lab, lab2, lab); /* { dg-error "duplicate asm operand name" } */
+lab:;
+lab2:;
+}
+
+void
+bar (void)
+{
+ asm goto ("" : : [lab] "i" (0) : : lab); /* { dg-error "duplicate asm operand name" } */
+lab:;
+}
+
+void
+baz (void)
+{
+ int x;
+ asm ("" : [lab] "=r" (x) : [lab] "r" (x)); /* { dg-error "duplicate asm operand name" } */
+}
diff --git a/gcc/testsuite/c-c++-common/tm/memcpy-1.c b/gcc/testsuite/c-c++-common/tm/memcpy-1.c
index fa841b26164..873e14bb1bc 100644
--- a/gcc/testsuite/c-c++-common/tm/memcpy-1.c
+++ b/gcc/testsuite/c-c++-common/tm/memcpy-1.c
@@ -1,6 +1,10 @@
/* { dg-do compile } */
/* { dg-options "-fgnu-tm" } */
-#include <string.h>
+typedef __SIZE_TYPE__ size_t;
+#ifdef __cplusplus
+extern "C"
+#endif
+void *memcpy (void *__restrict, const void *__restrict, size_t);
__attribute__((transaction_safe))
void *wmemcpy(void *dest, const void *src, size_t n)