Example #1
0
int main(int argc, char **argv)
{
   unsigned verbose = 0;
   FILE *fp = NULL;
   unsigned long n = 1000;
   unsigned i;
   boolean success;
   boolean single = FALSE;
   unsigned fpstate;

   util_cpu_detect();
   fpstate = util_fpstate_get();
   util_fpstate_set_denorms_to_zero(fpstate);

   if (!lp_build_init())
      return 1;

   for(i = 1; i < argc; ++i) {
      if(strcmp(argv[i], "-v") == 0)
         ++verbose;
      else if(strcmp(argv[i], "-s") == 0)
         single = TRUE;
      else if(strcmp(argv[i], "-o") == 0)
         fp = fopen(argv[++i], "wt");
      else
         n = atoi(argv[i]);
   }

#ifdef DEBUG
   if (verbose >= 2) {
      gallivm_debug |= GALLIVM_DEBUG_IR;
      gallivm_debug |= GALLIVM_DEBUG_ASM;
   }
#endif

   if (fp) {
      /* Warm up the caches */
      test_some(0, NULL, 100);

      write_tsv_header(fp);
   }
      
   if (single)
      success = test_single(verbose, fp);
   else if (n)
      success = test_some(verbose, fp, n);
   else
      success = test_all(verbose, fp);

   if (fp)
      fclose(fp);

   return success ? 0 : 1;
}
int main(int argc, char **argv)
{
   unsigned verbose = 0;
   FILE *fp = NULL;
   unsigned long n = 1000;
   unsigned i;
   boolean success;
   boolean single = FALSE;
   struct gallivm_state *gallivm;

   for(i = 1; i < argc; ++i) {
      if(strcmp(argv[i], "-v") == 0)
         ++verbose;
      else if(strcmp(argv[i], "-s") == 0)
         single = TRUE;
      else if(strcmp(argv[i], "-o") == 0)
         fp = fopen(argv[++i], "wt");
      else
         n = atoi(argv[i]);
   }

   lp_build_init();

   gallivm = gallivm_create();

   util_cpu_detect();

   if(fp) {
      /* Warm up the caches */
      test_some(gallivm, 0, NULL, 100);

      write_tsv_header(fp);
   }
      
   if (single)
      success = test_single(gallivm, verbose, fp);
   else if (n)
      success = test_some(gallivm, verbose, fp, n);
   else
      success = test_all(gallivm, verbose, fp);

   if(fp)
      fclose(fp);

   return success ? 0 : 1;
}
Example #3
0
static void test_main()
{

    book = qof_book_new ();

    test_use();

    test_some();

    test_all();

    qof_book_destroy (book);
}
Example #4
0
int main(int argc, char **argv)
{
   unsigned verbose = 0;
   FILE *fp = NULL;
   unsigned long n = 1000;
   unsigned i;
   boolean success;

   for(i = 1; i < argc; ++i) {
      if(strcmp(argv[i], "-v") == 0)
         ++verbose;
      else if(strcmp(argv[i], "-o") == 0)
         fp = fopen(argv[++i], "wt");
      else
         n = atoi(argv[i]);
   }

   LLVMLinkInJIT();
   LLVMInitializeNativeTarget();

   util_cpu_detect();

   if(fp) {
      /* Warm up the caches */
      test_some(0, NULL, 100);

      write_tsv_header(fp);
   }
      
   if(n)
      success = test_some(verbose, fp, n);
   else
      success = test_all(verbose, fp);

   if(fp)
      fclose(fp);

   return success ? 0 : 1;
}