From: Mike Stump Date: Sat, 19 Oct 2013 19:13:15 +0000 (+0000) Subject: lto.exp: Add support for C/C++ mix language testing. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7aa14ddbd7eb90ff4cff00baba826ebf82f328b4;p=gcc.git lto.exp: Add support for C/C++ mix language testing. * g++.dg/lto/lto.exp: Add support for C/C++ mix language testing. * gcc.dg/lto/pr54625-1_0.c: Move from here... * g++.dg/lto/pr54625-1_0.c: ... to here. * gcc.dg/lto/pr54625-1_1.C: Likewise. * g++.dg/lto/pr54625-1_1.C: Likewise. * gcc.dg/lto/pr54625-2_0.c: Likewise. * g++.dg/lto/pr54625-2_0.c: Likewise. * gcc.dg/lto/pr54625-2_1.C: Likewise. * g++.dg/lto/pr54625-2_1.C: Likewise. From-SVN: r203862 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0704c8e2fea..4df46ae4a2b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2013-10-19 Mike Stump + + * g++.dg/lto/lto.exp: Add support for C/C++ mix language testing. + + * gcc.dg/lto/pr54625-1_0.c: Move from here... + * g++.dg/lto/pr54625-1_0.c: ... to here. + * gcc.dg/lto/pr54625-1_1.C: Likewise. + * g++.dg/lto/pr54625-1_1.C: Likewise. + * gcc.dg/lto/pr54625-2_0.c: Likewise. + * g++.dg/lto/pr54625-2_0.c: Likewise. + * gcc.dg/lto/pr54625-2_1.C: Likewise. + * g++.dg/lto/pr54625-2_1.C: Likewise. + 2013-10-19 Oleg Endo * gcc.target/sh/pr54089-3.c: Fix test for load of constant 31. diff --git a/gcc/testsuite/g++.dg/lto/lto.exp b/gcc/testsuite/g++.dg/lto/lto.exp index 29cf3be991d..0c6025dd962 100644 --- a/gcc/testsuite/g++.dg/lto/lto.exp +++ b/gcc/testsuite/g++.dg/lto/lto.exp @@ -48,7 +48,7 @@ if { ![check_effective_target_lto] } { } # Main loop. -foreach src [lsort [find $srcdir/$subdir *_0.C]] { +foreach src [lsort [find $srcdir/$subdir *_0.\[cC\]]] { # If we're only testing specific files and this isn't one of them, skip it. if ![runtest_file_p $runtests $src] then { continue diff --git a/gcc/testsuite/g++.dg/lto/pr54625-1_0.c b/gcc/testsuite/g++.dg/lto/pr54625-1_0.c new file mode 100644 index 00000000000..5ab90ddddee --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr54625-1_0.c @@ -0,0 +1,10 @@ +/* { dg-lto-do link } */ +/* { dg-extra-ld-options { -r -nostdlib } } */ + +float a; +double sin (); +speex_resampler_init_frac () +{ + a = sin (0); +} + diff --git a/gcc/testsuite/g++.dg/lto/pr54625-1_1.C b/gcc/testsuite/g++.dg/lto/pr54625-1_1.C new file mode 100644 index 00000000000..2d0d5bfbadf --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr54625-1_1.C @@ -0,0 +1,19 @@ +extern "C" double sin (double); +typedef double UnaryFunType (double); +class A +{ +public: + int hash (); + double lookup (UnaryFunType p1) + { + int a = hash (); + if (p1) + return 0; + } +}; +A b; +void +math_sin_impl () +{ + b.lookup (sin); +} diff --git a/gcc/testsuite/g++.dg/lto/pr54625-2_0.c b/gcc/testsuite/g++.dg/lto/pr54625-2_0.c new file mode 100644 index 00000000000..6511ba5cc62 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr54625-2_0.c @@ -0,0 +1,9 @@ +/* { dg-lto-do link } */ +/* { dg-extra-ld-options { -r -nostdlib } } */ + +float a; +double sin (); +update_filter () +{ + a = sin (0); +} diff --git a/gcc/testsuite/g++.dg/lto/pr54625-2_1.C b/gcc/testsuite/g++.dg/lto/pr54625-2_1.C new file mode 100644 index 00000000000..09c365d2354 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr54625-2_1.C @@ -0,0 +1,24 @@ +extern "C" double sin (double); +typedef double (*UnaryFunType) (double); +class A +{ +public: + int hash (); + void lookup (UnaryFunType p1) + { + int a = hash (); + p1 (0); + } +}; +A b, c; +void +math_sin_impl () +{ + b.lookup (sin); +} + +void +js_math_sqrt () +{ + c.lookup (0); +} diff --git a/gcc/testsuite/gcc.dg/lto/pr54625-1_0.c b/gcc/testsuite/gcc.dg/lto/pr54625-1_0.c deleted file mode 100644 index 5ab90ddddee..00000000000 --- a/gcc/testsuite/gcc.dg/lto/pr54625-1_0.c +++ /dev/null @@ -1,10 +0,0 @@ -/* { dg-lto-do link } */ -/* { dg-extra-ld-options { -r -nostdlib } } */ - -float a; -double sin (); -speex_resampler_init_frac () -{ - a = sin (0); -} - diff --git a/gcc/testsuite/gcc.dg/lto/pr54625-1_1.C b/gcc/testsuite/gcc.dg/lto/pr54625-1_1.C deleted file mode 100644 index 2d0d5bfbadf..00000000000 --- a/gcc/testsuite/gcc.dg/lto/pr54625-1_1.C +++ /dev/null @@ -1,19 +0,0 @@ -extern "C" double sin (double); -typedef double UnaryFunType (double); -class A -{ -public: - int hash (); - double lookup (UnaryFunType p1) - { - int a = hash (); - if (p1) - return 0; - } -}; -A b; -void -math_sin_impl () -{ - b.lookup (sin); -} diff --git a/gcc/testsuite/gcc.dg/lto/pr54625-2_0.c b/gcc/testsuite/gcc.dg/lto/pr54625-2_0.c deleted file mode 100644 index 6511ba5cc62..00000000000 --- a/gcc/testsuite/gcc.dg/lto/pr54625-2_0.c +++ /dev/null @@ -1,9 +0,0 @@ -/* { dg-lto-do link } */ -/* { dg-extra-ld-options { -r -nostdlib } } */ - -float a; -double sin (); -update_filter () -{ - a = sin (0); -} diff --git a/gcc/testsuite/gcc.dg/lto/pr54625-2_1.C b/gcc/testsuite/gcc.dg/lto/pr54625-2_1.C deleted file mode 100644 index 09c365d2354..00000000000 --- a/gcc/testsuite/gcc.dg/lto/pr54625-2_1.C +++ /dev/null @@ -1,24 +0,0 @@ -extern "C" double sin (double); -typedef double (*UnaryFunType) (double); -class A -{ -public: - int hash (); - void lookup (UnaryFunType p1) - { - int a = hash (); - p1 (0); - } -}; -A b, c; -void -math_sin_impl () -{ - b.lookup (sin); -} - -void -js_math_sqrt () -{ - c.lookup (0); -}