Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 816

Show
Ignore:
Timestamp:
12/24/10 00:59:33 (14 years ago)
Author:
braddr
Message:

Disable -O for 64 bit tests for now.
Fix %.*s misuse in dhry.d

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/test/do_test.sh

    r815 r816  
    3838rm -f ${output_file} 
    3939 
    4040r_args=`grep REQUIRED_ARGS ${input_file} | tr -d \\\\r\\\\n` 
    4141if [ ! -z "${r_args}" ]; then 
    4242    r_args="${r_args/*REQUIRED_ARGS:*( )/}" 
    4343    if [ ! -z "${r_args}" ]; then 
    4444        extra_space=" " 
    4545    fi 
    4646fi 
    4747 
    4848p_args=`grep PERMUTE_ARGS ${input_file} | tr -d \\\\r\\\\n` 
    4949if [ -z "${p_args}" ]; then 
    5050    if [ "${input_dir}" != "fail_compilation" ]; then 
    5151        p_args="${ARGS}" 
    5252    fi 
    5353else 
    5454    p_args="${p_args/*PERMUTE_ARGS:*( )/}" 
    5555    if [ "${OS}" == "win32" ]; then 
    5656        p_args="${p_args/-fPIC/}" 
    5757    fi 
     58fi 
     59 
     60if [ "${MODEL}" == "64" ]; then 
     61    p_args="${p_args/-O/}" 
     62    r_args="${r_args/-O/}" 
    5863fi 
    5964 
    6065e_args=`grep EXECUTE_ARGS  ${input_file} | tr -d \\\\r\\\\n` 
    6166if [ ! -z "$e_args" ]; then 
    6267    e_args="${e_args/*EXECUTE_ARGS:*( )/}" 
    6368fi 
    6469 
    6570extra_sources=`grep EXTRA_SOURCES ${input_file} | tr -d \\\\r\\\\n` 
    6671if [ ! -z "${extra_sources}" ]; then 
    6772    # remove the field name, leaving just the list of files 
    6873    extra_sources=(${extra_sources/*EXTRA_SOURCES:*( )/}) 
    6974    # prepend the test dir (ie, runnable) to each extra file 
    7075    #extra_sources=(${extra_sources[*]/imports\//${input_dir}\/imports\/}) 
    7176    prefixed_extra_sources=() 
    7277    for tmp in ${extra_sources[*]}; do prefixed_extra_sources=(${prefixed_extra_sources[*]} "${input_dir}/${tmp}"); done 
    7378    all_sources=(${input_file} ${prefixed_extra_sources[*]}) 
    7479else 
    7580    all_sources=(${input_file}) 
    7681fi 
    7782# replace / with the correct separator 
  • trunk/test/runnable/dhry.d

    r553 r816  
    549549  printf ("        should be:   %d\n", 5); 
    550550  printf ("Bool_Glob:           %d\n", Bool_Glob); 
    551551  printf ("        should be:   %d\n", 1); 
    552552  printf ("Ch_1_Glob:           %c\n", Ch_1_Glob); 
    553553  printf ("        should be:   %c\n", cast(int)'A'); 
    554554  printf ("Ch_2_Glob:           %c\n", Ch_2_Glob); 
    555555  printf ("        should be:   %c\n", cast(int)'B'); 
    556556  printf ("Arr_1_Glob[8]:       %d\n", Arr_1_Glob[8]); 
    557557  printf ("        should be:   %d\n", 7); 
    558558  printf ("Arr_2_Glob[8][7]:    %d\n", Arr_2_Glob[8][7]); 
    559559  printf ("        should be:   Number_Of_Runs + 10\n"); 
    560560  printf ("Ptr_Glob.\n"); 
    561561  printf ("  Ptr_Comp:          %d\n", cast(int) Ptr_Glob.Ptr_Comp); 
    562562  printf ("        should be:   (implementation-dependent)\n"); 
    563563  printf ("  Discr:             %d\n", Ptr_Glob.Discr); 
    564564  printf ("        should be:   %d\n", 0); 
    565565  printf ("  Enum_Comp:         %d\n", Ptr_Glob.variant.var_1.Enum_Comp); 
    566566  printf ("        should be:   %d\n", 2); 
    567567  printf ("  Int_Comp:          %d\n", Ptr_Glob.variant.var_1.Int_Comp); 
    568568  printf ("        should be:   %d\n", 17); 
    569   printf ("  Str_Comp:          %.*s\n", Ptr_Glob.variant.var_1.Str_Comp); 
     569  printf ("  Str_Comp:          %.*s\n", Ptr_Glob.variant.var_1.Str_Comp.length, Ptr_Glob.variant.var_1.Str_Comp.ptr); 
    570570  printf ("        should be:   DHRYSTONE PROGRAM, SOME STRING\n"); 
    571571  printf ("Next_Ptr_Glob.\n"); 
    572572  printf ("  Ptr_Comp:          %d\n", cast(int) Next_Ptr_Glob.Ptr_Comp); 
    573573  printf ("        should be:   (implementation-dependent), same as above\n"); 
    574574  printf ("  Discr:             %d\n", Next_Ptr_Glob.Discr); 
    575575  printf ("        should be:   %d\n", 0); 
    576576  printf ("  Enum_Comp:         %d\n", Next_Ptr_Glob.variant.var_1.Enum_Comp); 
    577577  printf ("        should be:   %d\n", 1); 
    578578  printf ("  Int_Comp:          %d\n", Next_Ptr_Glob.variant.var_1.Int_Comp); 
    579579  printf ("        should be:   %d\n", 18); 
    580   printf ("  Str_Comp:          %.*s\n", Next_Ptr_Glob.variant.var_1.Str_Comp); 
     580  printf ("  Str_Comp:          %.*s\n", Next_Ptr_Glob.variant.var_1.Str_Comp.length, Next_Ptr_Glob.variant.var_1.Str_Comp.ptr); 
    581581  printf ("        should be:   DHRYSTONE PROGRAM, SOME STRING\n"); 
    582582  printf ("Int_1_Loc:           %d\n", Int_1_Loc); 
    583583  printf ("        should be:   %d\n", 5); 
    584584  printf ("Int_2_Loc:           %d\n", Int_2_Loc); 
    585585  printf ("        should be:   %d\n", 13); 
    586586  printf ("Int_3_Loc:           %d\n", Int_3_Loc); 
    587587  printf ("        should be:   %d\n", 7); 
    588588  printf ("Enum_Loc:            %d\n", Enum_Loc); 
    589589  printf ("        should be:   %d\n", 1); 
    590   printf ("Str_1_Loc:           %.*s\n", Str_1_Loc); 
     590  printf ("Str_1_Loc:           %.*s\n", Str_1_Loc.length, Str_1_Loc.ptr); 
    591591  printf ("        should be:   DHRYSTONE PROGRAM, 1'ST STRING\n"); 
    592   printf ("Str_2_Loc:           %.*s\n", Str_2_Loc); 
     592  printf ("Str_2_Loc:           %.*s\n", Str_2_Loc.length, Str_2_Loc.ptr); 
    593593  printf ("        should be:   DHRYSTONE PROGRAM, 2'ND STRING\n"); 
    594594  printf ("\n"); 
    595595 
    596596  User_Time = End_Time - Begin_Time; 
    597597 
    598598  if (User_Time < Too_Small_Time) 
    599599  { 
    600600    printf ("Measured time too small to obtain meaningful results\n"); 
    601601    printf ("Please increase number of runs\n"); 
    602602    printf ("\n"); 
    603603  } 
    604604  else 
    605605  { 
    606606    Microseconds = User_Time * Mic_secs_Per_Second  
    607607                        / cast(double) Number_Of_Runs; 
    608608    Dhrystones_Per_Second = cast(double) Number_Of_Runs / User_Time; 
    609609    Vax_Mips = Dhrystones_Per_Second / 1757.0; 
    610610 
    611611    printf ("Register option selected?  NO\n"); 
    612612    strcpy(Reg_Define.ptr, "Register option not selected."); 
    613613    printf ("Microseconds for one run through Dhrystone: "); 
    614614    printf ("%7.1lf \n", Microseconds); 
    615615    printf ("Dhrystones per Second:                      "); 
    616616    printf ("%10.1lf \n", Dhrystones_Per_Second); 
    617617    printf ("VAX MIPS rating = %10.3lf \n",Vax_Mips); 
    618618    printf ("\n"); 
    619619  
    620620   /+  
    621621  fprintf(Ap,"\n"); 
    622622  fprintf(Ap,"Dhrystone Benchmark, Version 2.1 (Language: D)\n"); 
    623   fprintf(Ap,"%.*s\n",Reg_Define); 
     623  fprintf(Ap,"%.*s\n",Reg_Define.length, Reg_Define.ptr); 
    624624  fprintf(Ap,"Microseconds for one loop: %7.1lf\n",Microseconds); 
    625625  fprintf(Ap,"Dhrystones per second: %10.1lf\n",Dhrystones_Per_Second); 
    626626  fprintf(Ap,"VAX MIPS rating: %10.3lf\n",Vax_Mips); 
    627627  fclose(Ap); 
    628628  +/ 
    629629   
    630630  } 
    631631   
    632632} 
    633633 
    634634void Proc_1 (Rec_Pointer Ptr_Val_Par) 
    635635/******************/ 
    636636 
    637637    /* executed once */ 
    638638{ 
    639639      Rec_Pointer Next_Record = Ptr_Val_Par.Ptr_Comp;   
    640640                                        /* == Ptr_Glob_Next */ 
    641641  /* Local variable, initialized with Ptr_Val_Par.Ptr_Comp,    */ 
    642642  /* corresponds to "rename" in Ada, "with" in Pascal           */ 
    643643