summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.misc-tests
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-04-11 09:13:11 +0000
committer <>2014-04-23 12:05:38 +0000
commit6af3fdec2262dd94954acc5e426ef71cbd4521d3 (patch)
tree9be02de9a80f7935892a2d03741adee44723e65d /gcc/testsuite/gcc.misc-tests
parent19be2b4342ac32e9edc78ce6fed8f61b63ae98d1 (diff)
downloadgcc-tarball-6af3fdec2262dd94954acc5e426ef71cbd4521d3.tar.gz
Imported from /home/lorry/working-area/delta_gcc-tarball/gcc-4.7.3.tar.bz2.gcc-4.7.3
Diffstat (limited to 'gcc/testsuite/gcc.misc-tests')
-rw-r--r--gcc/testsuite/gcc.misc-tests/bprob.exp18
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-12.c17
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-13.c20
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-14.c28
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-15.c30
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov.exp2
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcovpart-13b.c4
-rw-r--r--gcc/testsuite/gcc.misc-tests/i386-pf-3dnow-1.c3
-rw-r--r--gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c3
-rw-r--r--gcc/testsuite/gcc.misc-tests/i386-pf-none-1.c3
-rw-r--r--gcc/testsuite/gcc.misc-tests/i386-pf-sse-1.c3
-rw-r--r--gcc/testsuite/gcc.misc-tests/linkage.exp10
12 files changed, 120 insertions, 21 deletions
diff --git a/gcc/testsuite/gcc.misc-tests/bprob.exp b/gcc/testsuite/gcc.misc-tests/bprob.exp
index c05eced541..6f520ec729 100644
--- a/gcc/testsuite/gcc.misc-tests/bprob.exp
+++ b/gcc/testsuite/gcc.misc-tests/bprob.exp
@@ -30,16 +30,6 @@ set tool gcc
set prof_ext "gcda"
set perf_ext tim
-# Override the list defined in profopt.exp.
-set PROFOPT_OPTIONS [list \
- { -g } \
- { -O0 } \
- { -O1 } \
- { -O2 -DPERFTIME } \
- { -O3 -DPERFTIME } \
- { -O3 -g -DPERFTIME } \
- { -Os } ]
-
if $tracelevel then {
strace $tracelevel
}
@@ -47,8 +37,12 @@ if $tracelevel then {
# Load support procs.
load_lib profopt.exp
+# Save and override the default list defined in profopt.exp.
+set bprob_save_profopt_options $PROFOPT_OPTIONS
+set PROFOPT_OPTIONS [list { -O2 } { -O3 }]
+
set profile_options "-fprofile-arcs"
-set feedback_options "-fprofile-use"
+set feedback_options "-fbranch-probabilities"
foreach profile_option $profile_options feedback_option $feedback_options {
foreach src [lsort [glob -nocomplain $srcdir/$subdir/bprob-*.c]] {
@@ -59,3 +53,5 @@ foreach profile_option $profile_options feedback_option $feedback_options {
profopt-execute $src
}
}
+
+set PROFOPT_OPTIONS $bprob_save_profopt_options
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-12.c b/gcc/testsuite/gcc.misc-tests/gcov-12.c
new file mode 100644
index 0000000000..f3d6924c98
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/gcov-12.c
@@ -0,0 +1,17 @@
+/* Test gcov weak ellision. */
+
+/* { dg-do run { target native } } */
+/* { dg-require-weak "" } */
+/* { dg-options "-fprofile-arcs -ftest-coverage" } */
+
+int __attribute__ ((weak)) weak ()
+{
+ return 0; /* count(1) */
+}
+
+int main ()
+{
+ return weak (); /* count(1) */
+}
+
+/* { dg-final { run-gcov { -a gcov-12.c } } } */
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-13.c b/gcc/testsuite/gcc.misc-tests/gcov-13.c
new file mode 100644
index 0000000000..e443f48532
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/gcov-13.c
@@ -0,0 +1,20 @@
+/* Test gcov weak ellision. */
+
+/* { dg-options "-fprofile-arcs -ftest-coverage" } */
+/* { dg-require-weak "" } */
+/* { dg-do run { target native } } */
+/* { dg-additional-sources "gcovpart-13b.c" } */
+/* { dg-skip-if "weak ellision not supported" { { hppa*-*-hpux* } && { ! lp64 } } { "*" } { "" } } */
+
+int __attribute__ ((weak)) weak ()
+{
+ return 1; /* count(-) { xfail *-*-* } */
+}
+
+int main ()
+{
+ return weak (); /* count(1) */
+}
+
+/* { dg-final { run-gcov { -a gcov-13.c } { xfail *-*-* } } } */
+/* { dg-final { run-gcov { -a gcovpart-13b.c } } } */
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-14.c b/gcc/testsuite/gcc.misc-tests/gcov-14.c
new file mode 100644
index 0000000000..564b08eaa9
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/gcov-14.c
@@ -0,0 +1,28 @@
+/* Test gcov extern inline. */
+
+/* { dg-options "-O2 -fprofile-arcs -ftest-coverage" } */
+/* The following line arranges that Darwin has behavior like elf weak import. */
+/* { dg-additional-options "-flat_namespace -undefined suppress" { target *-*-darwin* } } */
+/* { dg-require-weak "" } */
+/* { dg-do run { target native } } */
+/* { dg-skip-if "undefined weak not supported" { alpha*-dec-osf* } } */
+/* { dg-skip-if "undefined weak not supported" { { hppa*-*-hpux* } && { ! lp64 } } } */
+
+extern int __attribute__ ((weak)) Foo ();
+
+extern __inline int Foo ()
+{
+ return 0; /* count(-) */
+}
+
+int (* __attribute__ ((noinline)) Bar ()) ()
+{
+ return Foo; /* count(1) */
+}
+
+int main ()
+{
+ return Bar () != 0; /* count(1) */
+}
+
+/* { dg-final { run-gcov { -a gcov-14.c } } } */
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-15.c b/gcc/testsuite/gcc.misc-tests/gcov-15.c
new file mode 100644
index 0000000000..04273fcec4
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/gcov-15.c
@@ -0,0 +1,30 @@
+/* Test gcov multiple paths to file. */
+
+/* { dg-options "-fprofile-arcs -ftest-coverage" } */
+/* { dg-do run { target native } } */
+
+#if !RECURSIVE
+#define RECURSIVE 1
+#include "./gcov-15.c"
+#undef RECURSIVE
+#endif
+
+static void __attribute__ ((noinline)) Recursive (void);
+
+
+#if RECURSIVE
+static void __attribute__ ((noinline))
+Recursive ()
+{
+ return; /* count(1) */
+}
+
+#else
+int main ()
+{
+ Recursive (); /* count(1) */
+ return 0;
+}
+#endif
+
+/* { dg-final { run-gcov { -a gcov-15.c } } } */
diff --git a/gcc/testsuite/gcc.misc-tests/gcov.exp b/gcc/testsuite/gcc.misc-tests/gcov.exp
index d433b99639..85a1c34abd 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov.exp
+++ b/gcc/testsuite/gcc.misc-tests/gcov.exp
@@ -33,7 +33,7 @@ if { ![is_remote host] && [string match "*/*" [lindex $GCC_UNDER_TEST 0]] } {
dg-init
# Delete old .gcda files.
-set files [glob -nocomplain gcov-*.gcda]
+set files [glob -nocomplain gcov*.gcda]
if { $files != "" } {
eval "remote_file build delete $files"
}
diff --git a/gcc/testsuite/gcc.misc-tests/gcovpart-13b.c b/gcc/testsuite/gcc.misc-tests/gcovpart-13b.c
new file mode 100644
index 0000000000..0900ab4802
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/gcovpart-13b.c
@@ -0,0 +1,4 @@
+int weak ()
+{
+ return 0; /* count(1) */
+}
diff --git a/gcc/testsuite/gcc.misc-tests/i386-pf-3dnow-1.c b/gcc/testsuite/gcc.misc-tests/i386-pf-3dnow-1.c
index ffb2e79530..638749a5a6 100644
--- a/gcc/testsuite/gcc.misc-tests/i386-pf-3dnow-1.c
+++ b/gcc/testsuite/gcc.misc-tests/i386-pf-3dnow-1.c
@@ -1,8 +1,7 @@
/* Test that the correct data prefetch instructions are generated for i386
variants that use 3DNow! prefetch instructions. */
-/* { dg-do compile { target i?86-*-* x86_64-*-*} } */
-/* { dg-require-effective-target ilp32 } */
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
extern void exit (int);
diff --git a/gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c b/gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c
index 8d5ad1efe7..d793437f17 100644
--- a/gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c
+++ b/gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c
@@ -2,8 +2,7 @@
variants that use 3DNow! prefetchw or SSE prefetch instructions with
locality hints. */
-/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-require-effective-target ilp32 } */
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
extern void exit (int);
diff --git a/gcc/testsuite/gcc.misc-tests/i386-pf-none-1.c b/gcc/testsuite/gcc.misc-tests/i386-pf-none-1.c
index d87a2100dd..04e814d5a9 100644
--- a/gcc/testsuite/gcc.misc-tests/i386-pf-none-1.c
+++ b/gcc/testsuite/gcc.misc-tests/i386-pf-none-1.c
@@ -1,8 +1,7 @@
/* Test that data prefetch instructions are not generated for i386 variants
that do not support those instructions. */
-/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-require-effective-target ilp32 } */
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
extern void exit (int);
diff --git a/gcc/testsuite/gcc.misc-tests/i386-pf-sse-1.c b/gcc/testsuite/gcc.misc-tests/i386-pf-sse-1.c
index fb47c9dfc5..3707c7074b 100644
--- a/gcc/testsuite/gcc.misc-tests/i386-pf-sse-1.c
+++ b/gcc/testsuite/gcc.misc-tests/i386-pf-sse-1.c
@@ -1,8 +1,7 @@
/* Test that the correct data prefetch instructions are generated for i386
variants that use SSE prefetch instructions. */
-/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-require-effective-target ilp32 } */
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
extern void exit (int);
diff --git a/gcc/testsuite/gcc.misc-tests/linkage.exp b/gcc/testsuite/gcc.misc-tests/linkage.exp
index 954dc29a50..887f31b21a 100644
--- a/gcc/testsuite/gcc.misc-tests/linkage.exp
+++ b/gcc/testsuite/gcc.misc-tests/linkage.exp
@@ -46,7 +46,8 @@ if { [isnative] && ![is_remote host] } then {
set native_cflags "-xarch=v9"
}
}
- if [istarget "i?86*-*-solaris2*"] {
+ if {[istarget "i?86*-*-solaris2*"]
+ || [istarget "x86_64-*-solaris2.1\[0-9\]*"]} {
set file_string [exec file "linkage-x.o"]
if [ string match "*64*" $file_string ] {
set native_cflags "-xarch=amd64"
@@ -87,6 +88,13 @@ if { [isnative] && ![is_remote host] } then {
} elseif [ string match "*ppc" $file_string ] {
set native_cflags "-m32"
}
+ } elseif [istarget "tilegx-*-linux*"] {
+ set file_string [exec file "linkage-x.o"]
+ if [ string match "*64-bit*" $file_string ] {
+ set native_cflags "-m64"
+ } elseif [ string match "*32-bit*" $file_string ] {
+ set native_cflags "-m32"
+ }
} elseif [istarget "*86*-*-darwin*"] {
set file_string [exec file "linkage-x.o"]
if [ string match "*64*" $file_string ] {