/* { dg-require-effective-target freorder } */
/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps -fdump-tree-optimized" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 1000000
+#else
+#define MAXITER 10000
+#endif
+
#define SIZE 10000
const char *sarr[SIZE];
int i;
buf_hot = "hello";
buf_cold = "world";
- for (i = 0; i < 1000000; i++)
+ for (i = 0; i < MAXITER; i++)
foo (argc);
return 0;
}
/* { dg-require-profiling "-fprofile-generate" } */
/* { dg-options "-O2 -flto -DDOJOB=1 -fdump-ipa-profile_estimate" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 350000000
+#else
+#define MAXITER 3500000
+#endif
+
#include <stdio.h>
typedef int (*fptr) (int);
x = one (3);
- for (i = 0; i < 350000000; i++)
+ for (i = 0; i < MAXITER; i++)
{
x = (*p) (3);
p = table[x];
/* { dg-require-profiling "-fprofile-generate" } */
/* { dg-options "-O2 -flto -DDOJOB=1 -fdump-ipa-profile_estimate" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 350000000
+#else
+#define MAXITER 3500000
+#endif
+
#include <stdio.h>
typedef int (*fptr) (int);
x = one (3);
- for (i = 0; i < 350000000; i++)
+ for (i = 0; i < MAXITER; i++)
{
x = (*p) (3);
p = table[x];
/* { dg-require-profiling "-fprofile-generate" } */
/* { dg-options "-O2 -fdump-ipa-profile_estimate" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 350000000
+#else
+#define MAXITER 3500000
+#endif
+
#include <stdio.h>
typedef int (*fptr) (int);
one (3);
- for (i = 0; i < 350000000; i++)
+ for (i = 0; i < MAXITER; i++)
{
x = (*p) (3);
p = table[x];
/* { dg-require-effective-target freorder } */
/* { dg-options "-O2 -fno-profile-reorder-functions -freorder-blocks-and-partition -save-temps" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 1000000
+#else
+#define MAXITER 10000
+#endif
+
#define SIZE 10000
#define NOINLINE __attribute__((noinline)) __attribute__ ((noclone))
int i;
buf_hot = "hello";
buf_cold = "world";
- for (i = 0; i < 1000000; i++)
+ for (i = 0; i < MAXITER; i++)
foo (argc);
return 0;
}
/* { dg-require-effective-target freorder } */
/* { dg-options "-O2 -fno-profile-reorder-functions -freorder-blocks-and-partition -save-temps" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 1000000
+#else
+#define MAXITER 10000
+#endif
+
#define SIZE 10000
#define NOINLINE __attribute__((noinline)) __attribute__ ((noclone))
int i;
buf_hot = "hello";
buf_cold = "world";
- for (i = 0; i < 1000000; i++)
+ for (i = 0; i < MAXITER; i++)
foo (argc);
return 0;
}
/* { dg-require-effective-target freorder } */
/* { dg-options "-O2 -fno-profile-reorder-functions -freorder-blocks-and-partition -save-temps" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 1000000
+#else
+#define MAXITER 10000
+#endif
+
#define SIZE 10000
#define NOINLINE __attribute__((noinline)) __attribute__ ((noclone))
int i;
buf_hot = "hello";
buf_cold = "world";
- for (i = 0; i < 1000000; i++)
+ for (i = 0; i < MAXITER; i++)
foo (argc);
return 0;
}
return
}
set profile_wrapper [profopt-perf-wrapper]
- set profile_option "-g"
- set feedback_option "-fauto-profile"
+ set profile_option "-g -DFOR_AUTOFDO_TESTING"
+ set feedback_option "-fauto-profile -DFOR_AUTOFDO_TESTING"
set run_autofdo 1
profopt-execute $src
unset profile_wrapper