summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr26427.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr26427.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr26427.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr26427.c b/gcc/testsuite/gcc.dg/pr26427.c
new file mode 100644
index 000000000..add13ca20
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr26427.c
@@ -0,0 +1,24 @@
+/* { dg-warning "this target does not support" "" {target *86*-*-darwin* } 0 } */
+/* { dg-do run { target { *-*-darwin* } } } */
+/* { dg-options { -fsection-anchors -O } } */
+/* PR target/26427 */
+
+struct a {};
+static const int d = 1;
+static const struct a b = {};
+static const int c = 1;
+int f(const int *, const struct a *, const int*, const int*);
+
+int g(void) {
+ return f(&c, &b, &d, &c);
+}
+
+int f(const int *b, const struct a *c, const int *d, const int *e) {
+ return *b == *d;
+}
+
+int main(void) {
+ if (!g())
+ __builtin_abort();
+ return 0;
+}