diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/lto')
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr55113_0.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr59626_0.c | 15 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr59626_1.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr60720_0.c | 15 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr60720_1.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr60820_0.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr60820_1.c | 11 |
7 files changed, 60 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/lto/pr55113_0.c b/gcc/testsuite/gcc.dg/lto/pr55113_0.c index 0477fe41bc8..8c309761bce 100644 --- a/gcc/testsuite/gcc.dg/lto/pr55113_0.c +++ b/gcc/testsuite/gcc.dg/lto/pr55113_0.c @@ -2,6 +2,7 @@ /* { dg-lto-do link } */ /* { dg-lto-options { { -flto -fshort-double -O0 } } }*/ /* { dg-skip-if "PR60410" { x86_64-*-* || { i?86-*-* && lp64 } } } */ +/* { dg-skip-if "PR60410" { i?86-*-solaris2.1[0-9]* } } */ int main(void) diff --git a/gcc/testsuite/gcc.dg/lto/pr59626_0.c b/gcc/testsuite/gcc.dg/lto/pr59626_0.c new file mode 100644 index 00000000000..752982fb506 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr59626_0.c @@ -0,0 +1,15 @@ +/* { dg-lto-do run } */ + +int __atoi (const char *) __asm__("atoi"); +extern inline __attribute__((always_inline,gnu_inline)) +int atoi (const char *x) +{ + return __atoi (x); +} + +int bar (int (*)(const char *)); + +int main() +{ + return bar (atoi); +} diff --git a/gcc/testsuite/gcc.dg/lto/pr59626_1.c b/gcc/testsuite/gcc.dg/lto/pr59626_1.c new file mode 100644 index 00000000000..9b3fa1d2e36 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr59626_1.c @@ -0,0 +1,4 @@ +int bar (int (*fn)(const char *)) +{ + return fn ("0"); +} diff --git a/gcc/testsuite/gcc.dg/lto/pr60720_0.c b/gcc/testsuite/gcc.dg/lto/pr60720_0.c new file mode 100644 index 00000000000..79cef5dad1a --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr60720_0.c @@ -0,0 +1,15 @@ +/* { dg-lto-do run } */ +/* { dg-extra-ld-options { -w } } */ + +/* ??? lto.exp does not allow to scan for + :1:12: warning: type of 'x' does not match original declaration + extern int x[]; + ^ + :1:5: note: previously declared here + int x; + ^ */ + +extern int x[]; +int *foo[] = { &x[0] }; + +int main() { return *foo[0]; } diff --git a/gcc/testsuite/gcc.dg/lto/pr60720_1.c b/gcc/testsuite/gcc.dg/lto/pr60720_1.c new file mode 100644 index 00000000000..6d1a0d47b7f --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr60720_1.c @@ -0,0 +1 @@ +int x; diff --git a/gcc/testsuite/gcc.dg/lto/pr60820_0.c b/gcc/testsuite/gcc.dg/lto/pr60820_0.c new file mode 100644 index 00000000000..349cf6a02f1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr60820_0.c @@ -0,0 +1,13 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options {{-flto -r -nostdlib -O2}} } */ +#include <stdio.h> +struct in6_addr {int bah;}; +extern const struct in6_addr in6addr_any; +static const struct in6_addr local_in6addr_any = {1}; +#pragma weak in6addr_any = local_in6addr_any + +__attribute__ ((used)) +void foo2() +{ + fprintf (stderr, "v1: %p, v2: %p\n", &local_in6addr_any, &in6addr_any); +} diff --git a/gcc/testsuite/gcc.dg/lto/pr60820_1.c b/gcc/testsuite/gcc.dg/lto/pr60820_1.c new file mode 100644 index 00000000000..16009e424f8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr60820_1.c @@ -0,0 +1,11 @@ +#include <stdio.h> +struct in6_addr {int bah;}; +extern const struct in6_addr in6addr_any; +static const struct in6_addr local_in6addr_any = {1}; +#pragma weak in6addr_any = local_in6addr_any + +__attribute__ ((used)) +void foo() +{ + fprintf (stderr, "v1: %p, v2: %p\n", &local_in6addr_any, &in6addr_any); +} |