summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr53084.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/pr53084.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr53084.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr53084.c b/gcc/testsuite/gcc.c-torture/execute/pr53084.c
new file mode 100644
index 000000000..1afc016df
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr53084.c
@@ -0,0 +1,18 @@
+/* PR middle-end/53084 */
+
+extern void abort (void);
+
+__attribute__((noinline, noclone)) void
+bar (const char *p)
+{
+ if (p[0] != 'o' || p[1] != 'o' || p[2])
+ abort ();
+}
+
+int
+main ()
+{
+ static const char *const foo[] = {"foo" + 1};
+ bar (foo[0]);
+ return 0;
+}