diff options
author | Dan Albert <danalbert@google.com> | 2015-10-13 16:28:19 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2015-10-13 16:28:19 -0700 |
commit | a8c075f72b231c37823661ba0d7d082a21cd39d9 (patch) | |
tree | 395aa3b848d56037292e50466643453485073018 /gcc-4.8/gcc/testsuite/gcc.dg/tree-prof | |
parent | 5aff2e0142aca13849b4e51de503e71d5010efa6 (diff) | |
download | toolchain_gcc-a8c075f72b231c37823661ba0d7d082a21cd39d9.tar.gz toolchain_gcc-a8c075f72b231c37823661ba0d7d082a21cd39d9.tar.bz2 toolchain_gcc-a8c075f72b231c37823661ba0d7d082a21cd39d9.zip |
Remove gcc-4.8.
Change-Id: Iee9c6985c613f58c82e33a91722d371579eb290f
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gcc.dg/tree-prof')
34 files changed, 0 insertions, 963 deletions
diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c deleted file mode 100644 index f850c9bfd..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c +++ /dev/null @@ -1,39 +0,0 @@ -/* { dg-require-effective-target freorder } */ -/* { dg-options "-O2 -freorder-blocks-and-partition" } */ - -#include <string.h> - -#define SIZE 1000 -int t0 = 0; -const char *t2[SIZE]; -char buf[SIZE]; - -void -foo (void) -{ - char *s = buf; - t0 = 1; - - for (;;) - { - if (*s == '\0') - break; - else - { - t2[t0] = s; - t0++; - } - *s++ = '\0'; - } - t2[t0] = NULL; -} - - -int -main () -{ - strcpy (buf, "hello"); - foo (); - return 0; -} - diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1.c deleted file mode 100644 index e9f3a418d..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* { dg-options "-O2 -fdump-ipa-profile" } */ -/* { dg-additional-sources "ic-misattribution-1a.c" } */ - -extern void other_caller (void); - -void -callee (void) -{ - return; -} - -void -caller(void (*func) (void)) -{ - func (); -} - -/* { dg-final-use { scan-ipa-dump "hist->count 1 hist->all 1" "profile" } } */ -/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c deleted file mode 100644 index fa9d6e705..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c +++ /dev/null @@ -1,22 +0,0 @@ -/* { dg-options "-DEMPTY" } */ -/* This file is only needed in combination with ic-misattribution-1.c - but there's no easy way to make this file ignored. */ -extern void callee (void); -extern void caller (void (*func) (void)); - -typedef void (*func_t) (void); -func_t func; - -int -main () -{ -#ifdef EMPTY -#else - func = callee; - caller (callee); - func (); -#endif - return 0; -} - -/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof.c deleted file mode 100644 index df7481f4d..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof.c +++ /dev/null @@ -1,43 +0,0 @@ -/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ - -static int a1 (void) -{ - return 10; -} - -static int a2 (void) -{ - return 0; -} - -typedef int (*tp) (void); - -static tp aa [] = {a2, a1, a1, a1, a1}; - -void setp (int (**pp) (void), int i) -{ - if (!i) - *pp = aa [i]; - else - *pp = aa [(i & 2) + 1]; -} - -int -main (void) -{ - int (*p) (void); - int i; - - for (i = 0; i < 10; i ++) - { - setp (&p, i); - p (); - } - - return 0; -} - -/* { dg-final-use { scan-ipa-dump "Indirect call -> direct call.* a1 transformation on insn" "profile"} } */ -/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ -/* { dg-final-use { cleanup-tree-dump "optimized" } } */ -/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c deleted file mode 100644 index b5340b56d..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c +++ /dev/null @@ -1,42 +0,0 @@ -/* { dg-options "-O2 -fdump-tree-optimized" } */ -int a; -int b[100]; -void abort (void); - -inline void -cold_function () -{ - int i; - for (i = 0; i < 99; i++) - if (b[i] / (b[i+1] + 1)) - abort (); -} - -inline void -hot_function () -{ - int i; - for (i = 0; i < 99; i++) - if (b[i] / (b[i+1] + 1)) - abort (); -} - -main () -{ - int i; - for (i = 0; i < 100; i++) - { - if (a) - cold_function (); - else - hot_function (); - } - return 0; -} - -/* cold function should be inlined, while hot function should not. - Look for "cold_function () [tail call];" call statement not for the - declaration or other apperances of the string in dump. */ -/* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */ -/* { dg-final-use { scan-tree-dump-not "hot_function ..;" "optimized"} } */ -/* { dg-final-use { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/peel-1.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/peel-1.c deleted file mode 100644 index 65f0c562c..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/peel-1.c +++ /dev/null @@ -1,25 +0,0 @@ -/* { dg-options "-O3 -fdump-rtl-loop2_unroll -fno-unroll-loops -fpeel-loops" } */ -void abort(); - -int a[1000]; -int -__attribute__ ((noinline)) -t() -{ - int i; - for (i=0;i<1000;i++) - if (!a[i]) - return 1; - abort (); -} -main() -{ - int i; - for (i=0;i<1000;i++) - t(); - return 0; -} -/* { dg-final-use { scan-rtl-dump "Considering simply peeling loop" "loop2_unroll" } } */ -/* In fact one peeling is enough; we however mispredict number of iterations of the loop - at least until loop_ch is schedule ahead of profiling pass. */ -/* { dg-final-use { cleanup-rtl-dump "loop2_unroll" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr34999.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr34999.c deleted file mode 100644 index 4ec42790e..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr34999.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Same test as built-in-setjmp.c. Includes the case where - the source block of a crossing fallthru edge ends with a call. */ -/* { dg-require-effective-target freorder } */ -/* { dg-options "-O2 -freorder-blocks-and-partition" } */ - -extern int strcmp(const char *, const char *); -extern char *strcpy(char *, const char *); -extern void abort(void); -extern void exit(int); - -void *buf[20]; - -void __attribute__((noinline)) -sub2 (void) -{ - __builtin_longjmp (buf, 1); -} - -int -main () -{ - char *p = (char *) __builtin_alloca (20); - - strcpy (p, "test"); - - if (__builtin_setjmp (buf)) - { - if (strcmp (p, "test") != 0) - abort (); - - exit (0); - } - - { - int *q = (int *) __builtin_alloca (p[2] * sizeof (int)); - int i; - - for (i = 0; i < p[2]; i++) - q[i] = 0; - - while (1) - sub2 (); - } -} - diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr44777.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr44777.c deleted file mode 100644 index 1c4da7f5f..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr44777.c +++ /dev/null @@ -1,43 +0,0 @@ -/* PR middle-end/44777 */ -/* { dg-options "-O0" } */ -/* A variant of gcc.c-torture/execute/comp-goto-2.c. */ - -extern void abort (void); -extern void exit (int); - -#ifdef STACK_SIZE -#define DEPTH ((STACK_SIZE) / 512 + 1) -#else -#define DEPTH 1000 -#endif - -#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) -int -x (int a) -{ - __label__ xlab; - void y (int a) - { - void *x = &&llab; - if (a==-1) - goto *x; - if (a==0) - goto xlab; - llab: - y (a-1); - } - y (a); - xlab:; - return a; -} -#endif - -int -main () -{ -#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) - if (x (DEPTH) != DEPTH) - abort (); -#endif - exit (0); -} diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr45354.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr45354.c deleted file mode 100644 index b30ad7769..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr45354.c +++ /dev/null @@ -1,43 +0,0 @@ -/* { dg-require-effective-target freorder } */ -/* { dg-options "-O -freorder-blocks-and-partition -fschedule-insns -fselective-scheduling" { target powerpc*-*-* ia64-*-* x86_64-*-* } } */ - -extern void abort (void); - -int ifelse_val2; - -int __attribute__((noinline)) -test_ifelse2 (int i) -{ - int result = 0; - if (!i) /* count(6) */ - result = 1; /* count(1) */ - if (i == 1) /* count(6) */ - result = 1024; - if (i == 2) /* count(6) */ - result = 2; /* count(3) */ - if (i == 3) /* count(6) */ - return 8; /* count(2) */ - if (i == 4) /* count(4) */ - return 2048; - return result; /* count(4) */ -} - -void __attribute__((noinline)) -call_ifelse () -{ - ifelse_val2 += test_ifelse2 (0); - ifelse_val2 += test_ifelse2 (2); - ifelse_val2 += test_ifelse2 (2); - ifelse_val2 += test_ifelse2 (2); - ifelse_val2 += test_ifelse2 (3); - ifelse_val2 += test_ifelse2 (3); -} - -int -main() -{ - call_ifelse (); - if (ifelse_val2 != 23) - abort (); - return 0; -} diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr47187.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr47187.c deleted file mode 100644 index 467ce252b..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr47187.c +++ /dev/null @@ -1,23 +0,0 @@ -/* PR bootstrap/47187 */ -/* { dg-options "-O2" } */ - -char buf[64]; -char buf2[64]; - -void * -foo (char *p, long size) -{ - return __builtin_memcpy (buf, p, size); -} - -int -main (void) -{ - long i; - for (i = 0; i < 65536; i++) - if (foo ("abcdefghijkl", 12) != buf) - __builtin_abort (); - if (foo (buf2, 64) != buf) - __builtin_abort (); - return 0; -} diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr49299-1.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr49299-1.c deleted file mode 100644 index dd45bafc7..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr49299-1.c +++ /dev/null @@ -1,34 +0,0 @@ -/* { dg-options "-O2" } */ - -__attribute__((noreturn)) void (*fn) (void); - -volatile int v; - -__attribute__((noreturn)) void -fn0 (void) -{ - __builtin_exit (0); -} - -__attribute__((noreturn)) void -fn1 (void) -{ - __builtin_exit (1); -} - -__attribute__((noinline, noclone)) void -setfn (__attribute__((noreturn)) void (*x) (void)) -{ - fn = x; -} - -int -main () -{ - int i; - if (v < 1) - setfn (fn0); - else - setfn (fn1); - fn (); -} diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr49299-2.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr49299-2.c deleted file mode 100644 index 220c8c8ff..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr49299-2.c +++ /dev/null @@ -1,34 +0,0 @@ -/* { dg-options "-O2" } */ - -void (*fn) (void); - -volatile int v; - -__attribute__((noreturn)) void -fn0 (void) -{ - __builtin_exit (0); -} - -void -fn1 (void) -{ -} - -__attribute__((noinline, noclone)) void -setfn (void (*x) (void)) -{ - fn = x; -} - -int -main () -{ - int i; - if (v < 1) - setfn (fn0); - else - setfn (fn1); - fn (); - return 0; -} diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr50907.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr50907.c deleted file mode 100644 index 2ba26e392..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr50907.c +++ /dev/null @@ -1,5 +0,0 @@ -/* PR middle-end/50907 */ -/* { dg-require-effective-target freorder } */ -/* { dg-options "-O -freorder-blocks-and-partition -fschedule-insns -fselective-scheduling -fpic" { target { { powerpc*-*-* ia64-*-* x86_64-*-* } && fpic } } } */ - -#include "pr45354.c" diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr52027.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr52027.c deleted file mode 100644 index c12f8b484..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr52027.c +++ /dev/null @@ -1,19 +0,0 @@ -/* PR debug/52027 */ -/* { dg-require-effective-target freorder } */ -/* { dg-options "-O -freorder-blocks-and-partition -fno-reorder-functions" } */ - -void -foo (int len) -{ - char array[1000]; - __builtin_memset (array, 0, len); -} - -int -main () -{ - int i; - for (i = 0; i < 1000; i++) - foo (8); - return 0; -} diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr52150.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr52150.c deleted file mode 100644 index accdb4a4c..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/pr52150.c +++ /dev/null @@ -1,16 +0,0 @@ -/* PR gcov-profile/52150 */ -/* { dg-options "-O0" } */ - -void foo () __asm__ ("bar"); - -void -foo () -{ -} - -int -main () -{ - foo (); - return 0; -} diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/prof-robust-1.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/prof-robust-1.c deleted file mode 100644 index 316cfc757..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/prof-robust-1.c +++ /dev/null @@ -1,25 +0,0 @@ -/* { dg-options "-O2 -w" } */ - -#include <stdio.h> -#include <stdlib.h> - -#ifdef _PROFILE_USE -int foo(int x) { - return 3 * x; -} -#else -int foo(int x) { - return 3 * x; -} -#endif - -int x = 1000; - -int main(int argc, char *argv[]) { - int i; - int sum = 0; - for (i = 0; i < x; i++) - sum += i; - printf("%d\n", sum); - return 0; -} diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c deleted file mode 100644 index f73061387..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c +++ /dev/null @@ -1,22 +0,0 @@ -/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ -int a[1000]; -int b[1000]; -int size=1; -int max=10000; -main() -{ - int i; - for (i=0;i<max; i++) - { - __builtin_memcpy (a, b, size * sizeof (a[0])); - asm(""); - } - return 0; -} -/* { dg-final-use { scan-ipa-dump "Single value 4 stringop" "profile"} } */ -/* Really this ought to simplify into assignment, but we are not there yet. */ -/* a[0] = b[0] is what we fold the resulting memcpy into. */ -/* { dg-final-use { scan-tree-dump " = MEM.*&b" "optimized"} } */ -/* { dg-final-use { scan-tree-dump "MEM.*&a\\\] = " "optimized"} } */ -/* { dg-final-use { cleanup-tree-dump "optimized" } } */ -/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c deleted file mode 100644 index f70fafba3..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c +++ /dev/null @@ -1,24 +0,0 @@ -/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ -int a[1000]; -int b[1000]; -int size=1; -int max=10000; -#ifdef __mips -/* We allow short memcpy()s for MIPS16. */ -int __attribute__((nomips16)) -#endif -main() -{ - int i; - for (i=0;i<max; i++) - { - __builtin_memset (a, 10, size * sizeof (a[0])); - asm(""); - } - return 0; -} -/* { dg-final-use { scan-ipa-dump "Single value 4 stringop" "profile"} } */ -/* The versioned memset of size 4 should be optimized to an assignment. */ -/* { dg-final-use { scan-tree-dump "a\\\[0\\\] = 168430090" "optimized"} } */ -/* { dg-final-use { cleanup-tree-dump "optimized" } } */ -/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/switch-case-1.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/switch-case-1.c deleted file mode 100644 index 50ee9e44f..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/switch-case-1.c +++ /dev/null @@ -1,40 +0,0 @@ -/* { dg-options "-O2 -fdump-rtl-expand-all" } */ -int g; - -__attribute__((noinline)) void foo (int n) -{ - switch (n) - { - case 1: - g++; break; - case 2: - g += 2; break; - case 3: - g += 1; break; - case 4: - g += 3; break; - case 5: - g += 4; break; - case 6: - g += 5; break; - case 7: - g += 6; break; - case 8: - g += 7; break; - case 9: - g += 8; break; - default: - g += 8; break; - } -} - -int main () -{ - int i; - for (i = 0; i < 10000; i++) - foo ((i * i) % 5); - return 0; -} -/* { dg-final-use { scan-rtl-dump-times ";; basic block\[^\\n\]*count 4000" 2 "expand"} } */ -/* { dg-final-use { scan-rtl-dump-times ";; basic block\[^\\n\]*count 2000" 1 "expand"} } */ -/* { dg-final-use { cleanup-rtl-dump "expand" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/switch-case-2.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/switch-case-2.c deleted file mode 100644 index 07d4363d3..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/switch-case-2.c +++ /dev/null @@ -1,40 +0,0 @@ -/* { dg-options "-O2 -fdump-rtl-expand-all" } */ -int g; - -__attribute__((noinline)) void foo (int n) -{ - switch (n) - { - case 99: - g += 2; break; - case 1: - g++; break; - case 100: - g += 1; break; - case 4: - g += 3; break; - case 5: - g += 4; break; - case 6: - g += 5; break; - case 7: - g += 6; break; - case 8: - g += 7; break; - case 9: - g += 8; break; - default: - g += 8; break; - } -} - -int main () -{ - int i; - for (i = 0; i < 10000; i++) - foo ((i * i) % 5); - return 0; -} -/* { dg-final-use { scan-rtl-dump-times ";; basic block\[^\\n\]*count 4000" 2 "expand"} } */ -/* { dg-final-use { scan-rtl-dump-times ";; basic block\[^\\n\]*count 2000" 1 "expand"} } */ -/* { dg-final-use { cleanup-rtl-dump "expand" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/tracer-1.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/tracer-1.c deleted file mode 100644 index 385a1a5c2..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/tracer-1.c +++ /dev/null @@ -1,18 +0,0 @@ -/* { dg-options "-O2 -ftracer -fdump-tree-tracer" } */ -volatile int a, b, c; -int main () -{ - int i; - for (i = 0; i < 1000; i++) - { - if (i % 17) - a++; - else - b++; - c++; - } - return 0; -} -/* Superblock formation should produce two copies of the increment of c */ -/* { dg-final-generate { scan-tree-dump-times "c =" 2 "tracer" } } */ -/* { dg-final-use { cleanup-tree-dump "tracer" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp deleted file mode 100644 index 1f50eb322..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (C) 2001-2013 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GCC; see the file COPYING3. If not see -# <http://www.gnu.org/licenses/>. - -# Test the functionality of programs compiled with profile-directed block -# ordering using -fprofile-generate followed by -fbranch-use. - -load_lib target-supports.exp - -# Some targets don't support tree profiling. -if { ![check_profiling_available "-fprofile-generate"] } { - return -} - -# The procedures in profopt.exp need these parameters. -set tool gcc -set prof_ext "gcda" - -if $tracelevel then { - strace $tracelevel -} - -# Load support procs. -load_lib profopt.exp - -# Save and override the default list defined in profopt.exp. -set treeprof_save_profopt_options $PROFOPT_OPTIONS -set PROFOPT_OPTIONS [list {}] - -# These are globals used by profopt-execute. The first is options -# needed to generate profile data, the second is options to use the -# profile data. -set profile_option "-fprofile-generate -D_PROFILE_GENERATE" -set feedback_option "-fprofile-use -D_PROFILE_USE" - -foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { - # If we're only testing specific files and this isn't one of them, skip it. - if ![runtest_file_p $runtests $src] then { - continue - } - profopt-execute $src -} - -set PROFOPT_OPTIONS $treeprof_save_profopt_options diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/unroll-1.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/unroll-1.c deleted file mode 100644 index 0663b1286..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/unroll-1.c +++ /dev/null @@ -1,23 +0,0 @@ -/* { dg-options "-O3 -fdump-rtl-loop2_unroll -funroll-loops -fno-peel-loops" } */ -void abort (); - -int a[1000]; -int -__attribute__ ((noinline)) -t() -{ - int i; - for (i=0;i<1000;i++) - if (!a[i]) - return 1; - abort (); -} -main() -{ - int i; - for (i=0;i<1000;i++) - t(); - return 0; -} -/* { dg-final-use { scan-rtl-dump "Considering unrolling loop with constant number of iterations" "loop2_unroll" } } */ -/* { dg-final-use { cleanup-rtl-dump "loop2_unroll" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/update-cunroll-2.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/update-cunroll-2.c deleted file mode 100644 index d559b9245..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/update-cunroll-2.c +++ /dev/null @@ -1,21 +0,0 @@ - -/* { dg-options "-O2 -fdump-tree-optimized-blocks" } */ -int a[8]; -__attribute__ ((noinline)) -int t() -{ - int i; - for (i = 0; i < 3; i++) - if (a[i]) - break; - return i; -} -main () -{ - int i; - for (i = 0; i < 1000; i++) - t (); - return 0; -} -/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ -/* { dg-final-use { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/update-loopch.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/update-loopch.c deleted file mode 100644 index e2656a306..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/update-loopch.c +++ /dev/null @@ -1,21 +0,0 @@ -/* { dg-options "-O2 -fdump-ipa-profile-blocks-details -fdump-tree-optimized-blocks-details" } */ -int max = 33333; -int a[8]; -int -main () -{ - int i; - for (i = 0; i < max; i++) - { - a[i % 8]++; - } - return 0; -} -/* Loop header copying will peel away the initial conditional, so the loop body - is once reached directly from entry point of function, rest via loopback - edge. */ -/* { dg-final-use { scan-ipa-dump "loop depth 0, count 33334" "profile"} } */ -/* { dg-final-use { scan-tree-dump "loop depth 1, count 33332" "optimized"} } */ -/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ -/* { dg-final-use { cleanup-ipa-dump "profile" } } */ -/* { dg-final-use { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/update-tailcall.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/update-tailcall.c deleted file mode 100644 index 285491445..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/update-tailcall.c +++ /dev/null @@ -1,20 +0,0 @@ -/* { dg-options "-O2 -fdump-tree-tailc -fdump-tree-optimized" } */ -__attribute__ ((noinline)) -int factorial(int x) -{ - if (x == 1) - return 1; - else - return x*factorial(--x); -} -int gbl; -int -main() -{ - gbl = factorial(100); - return 0; -} -/* { dg-final-use { scan-tree-dump-not "Invalid sum" "tailc"} } */ -/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ -/* { dg-final-use { cleanup-tree-dump "tailc" } } */ -/* { dg-final-use { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c deleted file mode 100644 index d6f603e8b..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c +++ /dev/null @@ -1,22 +0,0 @@ -/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ -int a[1000]; -int b = 256; -int c = 257; -main () -{ - int i; - int n; - for (i = 0; i < 1000; i++) - { - if (i % 17) - n = c; - else n = b; - a[i] /= n; - } - return 0; -} -/* { dg-final-use { scan-ipa-dump "Div.mod by constant n_\[0-9\]*=257 transformation on insn" "profile"} } */ -/* { dg-final-use { scan-tree-dump "if \\(n_\[0-9\]* != 257\\)" "optimized"} } */ -/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ -/* { dg-final-use { cleanup-tree-dump "optimized" } } */ -/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c deleted file mode 100644 index 16839612d..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c +++ /dev/null @@ -1,32 +0,0 @@ -/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ -unsigned int a[1000]; -unsigned int b = 256; -unsigned int c = 1024; -unsigned int d = 17; -main () -{ - int i; - unsigned int n; - for (i = 0; i < 1000; i++) - { - a[i]=100*i; - } - for (i = 0; i < 1000; i++) - { - if (i % 2) - n = b; - else if (i % 3) - n = c; - else - n = d; - a[i] %= n; - } - return 0; -} -/* { dg-final-use { scan-ipa-dump "Mod power of 2 transformation on insn" "profile" } } */ -/* This is part of code checking that n is power of 2, so we are sure that the transformation - didn't get optimized out. */ -/* { dg-final-use { scan-tree-dump "n_\[0-9\]* \\+ (4294967295|0x0*ffffffff)" "optimized"} } */ -/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ -/* { dg-final-use { cleanup-tree-dump "optimized" } } */ -/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c deleted file mode 100644 index d7b3914a8..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c +++ /dev/null @@ -1,32 +0,0 @@ -/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ -unsigned int a[1000]; -unsigned int b = 257; -unsigned int c = 1023; -unsigned int d = 19; -main () -{ - int i; - unsigned int n; - for (i = 0; i < 1000; i++) - { - a[i]=18; - } - for (i = 0; i < 1000; i++) - { - if (i % 2) - n = b; - else if (i % 3) - n = c; - else - n = d; - a[i] %= n; - } - return 0; -} -/* { dg-final-use { scan-ipa-dump "Mod subtract transformation on insn" "profile" } } */ -/* This is part of code checking that n is greater than the divisor so we are sure that it - didn't get optimized out. */ -/* { dg-final-use { scan-tree-dump "if \\(n_\[0-9\]* \\>" "optimized"} } */ -/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ -/* { dg-final-use { cleanup-tree-dump "optimized" } } */ -/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c deleted file mode 100644 index 239bf595d..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c +++ /dev/null @@ -1,32 +0,0 @@ -/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ -unsigned int a[1000]; -unsigned int b = 999; -unsigned int c = 1002; -unsigned int d = 1003; -main () -{ - int i; - unsigned int n; - for (i = 0; i < 1000; i++) - { - a[i]=1000+i; - } - for (i = 0; i < 1000; i++) - { - if (i % 2) - n = b; - else if (i % 3) - n = c; - else - n = d; - a[i] %= n; - } - return 0; -} -/* { dg-final-use { scan-ipa-dump "Mod subtract transformation on insn" "profile" } } */ -/* This is part of code checking that n is greater than the divisor so we are sure that it - didn't get optimized out. */ -/* { dg-final-use { scan-tree-dump "if \\(n_\[0-9\]* \\>" "optimized"} } */ -/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ -/* { dg-final-use { cleanup-tree-dump "optimized" } } */ -/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c deleted file mode 100644 index 1a804a767..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c +++ /dev/null @@ -1,17 +0,0 @@ -/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ -int a[1000]; -int b=997; -main() -{ - int i; - for (i = 0; i < 1000; i++) - if (a[i]) - a[i]/=b; - else - a[i]/=b; - return 0; -} -/* { dg-final-use { scan-ipa-dump "Div.mod by constant b.*=997 transformation on insn" "profile" } } */ -/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ -/* { dg-final-use { cleanup-tree-dump "optimized" } } */ -/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-6.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-6.c deleted file mode 100644 index c439fcffe..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-6.c +++ /dev/null @@ -1,20 +0,0 @@ -/* { dg-options "-O2 -fdump-tree-optimized" } */ -char a[1000]; -char b[1000]; -int size=1000; -__attribute__ ((noinline)) -t(int size) -{ - __builtin_memcpy(a,b,size); -} -int -main() -{ - int i; - for (i=0; i < size; i++) - t(i); - return 0; -} -/* { dg-final-use { scan-tree-dump "Average value sum:499500" "optimized"} } */ -/* { dg-final-use { scan-tree-dump "IOR value" "optimized"} } */ -/* { dg-final-use { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c deleted file mode 100644 index 6c64d0795..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c +++ /dev/null @@ -1,26 +0,0 @@ -/* { dg-options "-O2 -fdump-ipa-profile -mtune=core2" } */ -/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */ - -extern void bzero (void *, __SIZE_TYPE__); - -int foo(int len) -{ - char array[1000]; - bzero(array, len); - return 0; -} - -int main() { - int i; - for (i = 0; i < 1000; i++) - { - if (i > 990) - foo(16); - else - foo(8); - } - return 0; -} - -/* { dg-final-use { scan-ipa-dump "Single value 8 stringop transformation on bzero" "profile" } } */ -/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/wcoverage-mismatch.c b/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/wcoverage-mismatch.c deleted file mode 100644 index e4231057f..000000000 --- a/gcc-4.8/gcc/testsuite/gcc.dg/tree-prof/wcoverage-mismatch.c +++ /dev/null @@ -1,20 +0,0 @@ -/* { dg-options "-O2 -Wno-coverage-mismatch" } */ - -int __attribute__((noinline)) bar (void) -{ -} - -int foo (int i) -{ -#ifdef _PROFILE_USE - if (i) - bar (); -#endif - return 0; -} - -int main(int argc, char **argv) -{ - foo (argc); - return 0; -} |