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

Changeset 815

Show
Ignore:
Timestamp:
12/23/10 20:36:27 (14 years ago)
Author:
braddr
Message:

Fix a number of tests to be 64 bit compatible.
Reintroduce the do_test.sh script for use with testing 64 bit (since the d version doesn't work yet).
Disable all the failing tests for 64 bit test runs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/test/compilable/extra-files/header.di

    r663 r815  
    11module foo.bar; 
    2 private import std.stdio
    3  
     2import core.vararg
     3import std.stdio; 
    44pragma (lib, "test"); 
    55pragma (msg, "Hello World"); 
    66typedef double mydbl = 10; 
    77int main() 
    88in 
    99{ 
    1010assert(1 + (2 + 3) == -(1 - 2 * 3)); 
    1111} 
    1212out(result) 
    1313{ 
    1414assert(result == 0); 
    1515} 
    1616body 
    1717{ 
    1818float f = (float).infinity; 
    1919int i = cast(int)f; 
    2020writeln((i , 1),2); 
    2121writeln(cast(int)(float).max); 
    2222assert(i == cast(int)(float).max); 
    2323assert(i == -2147483648u); 
  • trunk/test/compilable/header.d

    r624 r815  
    11// PERMUTE_ARGS: 
    22// REQUIRED_ARGS: -H -Hdtest_results/compilable 
    33// POST_SCRIPT: compilable/extra-files/header-postscript.sh 
    44 
    55module foo.bar; 
    66 
    7 private import std.stdio; 
     7import core.vararg; 
     8import std.stdio; 
    89 
    910pragma(lib, "test"); 
    1011pragma(msg, "Hello World"); 
    1112 
    1213typedef double mydbl = 10; 
    1314 
    1415int main() 
    1516in 
    1617{ 
    1718    assert(1+(2+3) == -(1 - 2*3)); 
    1819} 
    1920out (result) 
    2021{ 
    2122    assert(result == 0); 
    2223} 
    2324body 
    2425{ 
    2526    float f = float.infinity; 
    2627    int i = cast(int) f; 
    2728    writeln((i,1),2); 
  • trunk/test/fail_compilation/fail194.d

    r576 r815  
     1import core.vararg; 
    12 
    23void bar(int i, ...) { } 
    34 
    45void foo() { } 
    56void foo(int) { } 
    67 
    78void main() 
    89{ 
    910    //bar(1, cast(void function())&foo); 
    1011    bar(1, &foo); 
    1112} 
  • trunk/test/fail_compilation/fail332.d

    r576 r815  
     1import core.vararg; 
     2 
    13void foo(int,...) {} 
    24 
    35void bar(){ 
    46   foo(); 
    57} 
    68 
  • trunk/test/Makefile

    r799 r815  
    7676export SEP=$(shell echo '\') 
    7777# bug in vim syntax hilighting, needed to kick it back into life: ') 
    7878else 
    7979export ARGS=-inline -release -gc -O -unittest -fPIC 
    8080export DMD=../src/dmd 
    8181export EXE= 
    8282export OBJ=.o 
    8383export DSEP=/ 
    8484export SEP=/ 
    8585endif 
    8686 
    8787runnable_tests=$(wildcard runnable/*.d) $(wildcard runnable/*.html) $(wildcard runnable/*.sh) 
    8888runnable_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(runnable_tests))) 
    8989 
    9090compilable_tests=$(wildcard compilable/*.d) 
    9191compilable_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(compilable_tests))) 
    9292 
    9393fail_compilation_tests=$(wildcard fail_compilation/*.d) 
    9494fail_compilation_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(fail_compilation_tests))) 
    9595 
     96all: run_tests 
     97 
     98ifeq ($(MODEL),64) 
     99DISABLED_TESTS = \ 
     100    a20           \ 
     101    argufilem     \ 
     102    arrayop       \ 
     103    builtin       \ 
     104    complex       \ 
     105    constfold     \ 
     106    cov2          \ 
     107    delegate      \ 
     108    dhry          \ 
     109    eh2           \ 
     110    foreach4      \ 
     111    foreach5      \ 
     112    hello-profile \ 
     113    hospital      \ 
     114    ifti          \ 
     115    implicit      \ 
     116    inner         \ 
     117    integrate     \ 
     118    interpret2    \ 
     119    interpret     \ 
     120    lazy          \ 
     121    mixin1        \ 
     122    mixin2        \ 
     123    nested        \ 
     124    pi            \ 
     125    printargs     \ 
     126    s2ir          \ 
     127    sieve         \ 
     128    statictor     \ 
     129    stress        \ 
     130    template1     \ 
     131    template4     \ 
     132    template6     \ 
     133    template9     \ 
     134    test11        \ 
     135    test12        \ 
     136    test16        \ 
     137    test19        \ 
     138    test20        \ 
     139    test22        \ 
     140    test23        \ 
     141    test28        \ 
     142    test34        \ 
     143    test36        \ 
     144    test37        \ 
     145    test42        \ 
     146    test4         \ 
     147    test52        \ 
     148    test60        \ 
     149    test7         \ 
     150    test8         \ 
     151    testaa2       \ 
     152    testaa        \ 
     153    testarray     \ 
     154    testconst     \ 
     155    testdate      \ 
     156    testdstress   \ 
     157    testformat    \ 
     158    testgc2       \ 
     159    testgc3       \ 
     160    testline      \ 
     161    testmath      \ 
     162    testmmfile    \ 
     163    testregexp2   \ 
     164    testsignals   \ 
     165    testfile      \ 
     166    testswitch    \ 
     167    testthread2   \ 
     168    testtypeid    \ 
     169    testzip       \ 
     170    traits        \ 
     171    untag         \ 
     172    variadic      \ 
     173    wc2           \ 
     174    wc3           \ 
     175    wc            \ 
     176    xtest46       \ 
     177    xtest55 
     178 
     179$(addsuffix .d.out,$(addprefix $(RESULTS_DIR)/runnable/,$(DISABLED_TESTS))): $(RESULTS_DIR)/.created 
     180    $(QUIET) echo " ... $@ - disabled" 
     181    $(QUIET) touch $@ 
     182 
     183$(RESULTS_DIR)/runnable/test2.sh.out: 
     184    $(QUIET) echo " ... $@ - disabled" 
     185    $(QUIET) touch $@ 
     186 
     187$(RESULTS_DIR)/runnable/%.d.out: runnable/%.d $(RESULTS_DIR)/.created $(RESULTS_DIR)/combinations $(DMD) 
     188    $(QUIET) ./do_test.sh $(<D) $* d 
     189 
     190$(RESULTS_DIR)/runnable/%.html.out: runnable/%.html $(RESULTS_DIR)/.created $(RESULTS_DIR)/combinations $(DMD) 
     191    $(QUIET) ./do_test.sh $(<D) $* html 
     192 
     193$(RESULTS_DIR)/runnable/%.sh.out: runnable/%.sh $(RESULTS_DIR)/.created $(RESULTS_DIR)/combinations $(DMD) 
     194    $(QUIET) echo " ... $(<D)/$*.sh" 
     195    $(QUIET) ./$(<D)/$*.sh 
     196 
     197$(RESULTS_DIR)/compilable/%.d.out: compilable/%.d $(RESULTS_DIR)/.created $(RESULTS_DIR)/combinations $(DMD) 
     198    $(QUIET) ./do_test.sh $(<D) $* d 
     199 
     200$(RESULTS_DIR)/fail_compilation/%.d.out: fail_compilation/%.d $(RESULTS_DIR)/.created $(RESULTS_DIR)/combinations $(DMD) 
     201    $(QUIET) ./do_test.sh $(<D) $* d 
     202else 
    96203$(RESULTS_DIR)/runnable/%.d.out: runnable/%.d $(RESULTS_DIR)/.created $(RESULTS_DIR)/d_do_test $(DMD) 
    97204    $(QUIET) ./$(RESULTS_DIR)/d_do_test $(<D) $* d 
    98205 
    99206$(RESULTS_DIR)/runnable/%.html.out: runnable/%.html $(RESULTS_DIR)/.created $(RESULTS_DIR)/d_do_test $(DMD) 
    100207    $(QUIET) ./$(RESULTS_DIR)/d_do_test $(<D) $* html 
    101208 
    102209$(RESULTS_DIR)/runnable/%.sh.out: runnable/%.sh $(RESULTS_DIR)/.created $(RESULTS_DIR)/d_do_test $(DMD) 
    103210    $(QUIET) echo " ... $(<D)/$*.sh" 
    104211    $(QUIET) ./$(<D)/$*.sh 
    105212 
    106213$(RESULTS_DIR)/compilable/%.d.out: compilable/%.d $(RESULTS_DIR)/.created $(RESULTS_DIR)/d_do_test $(DMD) 
    107214    $(QUIET) ./$(RESULTS_DIR)/d_do_test $(<D) $* d 
    108215 
    109216$(RESULTS_DIR)/fail_compilation/%.d.out: fail_compilation/%.d $(RESULTS_DIR)/.created $(RESULTS_DIR)/d_do_test $(DMD) 
    110217    $(QUIET) ./$(RESULTS_DIR)/d_do_test $(<D) $* d 
    111  
    112 all: run_tests 
     218endif 
    113219 
    114220quick: 
    115221    $(MAKE) ARGS="" run_tests 
    116222 
    117223clean: 
    118224    @echo "Removing output directory: $(RESULTS_DIR)" 
    119225    $(QUIET)if [ -e $(RESULTS_DIR) ]; then rm -rf $(RESULTS_DIR); fi 
    120226 
    121227$(RESULTS_DIR)/.created: 
    122228    @echo Creating output directory: $(RESULTS_DIR)  
    123229    $(QUIET)if [ ! -d $(RESULTS_DIR) ]; then mkdir $(RESULTS_DIR); fi 
    124230    $(QUIET)if [ ! -d $(RESULTS_DIR)/runnable ]; then mkdir $(RESULTS_DIR)/runnable; fi 
    125231    $(QUIET)if [ ! -d $(RESULTS_DIR)/compilable ]; then mkdir $(RESULTS_DIR)/compilable; fi 
    126232    $(QUIET)if [ ! -d $(RESULTS_DIR)/fail_compilation ]; then mkdir $(RESULTS_DIR)/fail_compilation; fi 
    127233    $(QUIET)touch $(RESULTS_DIR)/.created 
    128234 
    129235run_tests: start_runnable_tests start_compilable_tests start_fail_compilation_tests 
    130236 
    131237run_runnable_tests: $(runnable_test_results) 
    132238 
    133239start_runnable_tests: $(RESULTS_DIR)/.created $(RESULTS_DIR)/d_do_test 
    134240    @echo "Running runnable tests" 
    135241    $(QUIET)$(MAKE) --no-print-directory run_runnable_tests 
    136242 
    137243run_compilable_tests: $(compilable_test_results) 
    138244 
    139245start_compilable_tests: $(RESULTS_DIR)/.created $(RESULTS_DIR)/d_do_test 
    140246    @echo "Running compilable tests" 
    141247    $(QUIET)$(MAKE) --no-print-directory run_compilable_tests 
    142248 
    143249run_fail_compilation_tests: $(fail_compilation_test_results) 
    144250 
    145251start_fail_compilation_tests: $(RESULTS_DIR)/.created $(RESULTS_DIR)/d_do_test 
    146252    @echo "Running fail compilation tests" 
    147253    $(QUIET)$(MAKE) --no-print-directory run_fail_compilation_tests 
    148254 
    149255$(RESULTS_DIR)/d_do_test: d_do_test.d $(RESULTS_DIR)/.created 
    150256    @echo "Building d_do_test tool" 
    151257    $(QUIET)$(DMD) -m$(MODEL) -od$(RESULTS_DIR) -of$(RESULTS_DIR)$(DSEP)d_do_test d_do_test.d 
    152258 
     259$(RESULTS_DIR)/combinations: combinations.d $(RESULTS_DIR)/.created 
     260    @echo "Building combinations tool" 
     261    $(QUIET)$(DMD) -m$(MODEL) -od$(RESULTS_DIR) -of$(RESULTS_DIR)$(DSEP)combinations combinations.d 
     262 
  • trunk/test/runnable/imports/argufile.d

    r575 r815  
    11// argufile.d ---------------------------------------------------- 
    22 
    33public: 
    44 
     5import core.vararg; 
    56import std.stdio; 
    67import std.format; 
    78import std.utf; 
    89 
    910dstring formatstring(TypeInfo[] arguments, void *argptr)  
    1011{ 
    1112 
    1213    dstring message = null;  
    1314 
    1415    void putc(dchar c) 
    1516    { 
    1617        message ~= c;  
    1718    } 
    1819 
    1920 
    2021    std.format.doFormat(&putc, arguments, argptr); 
    2122 
    2223     
    2324    return message;  
    2425} 
  • trunk/test/runnable/imports/inline2a.d

    r574 r815  
    137137        7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 
    138138        7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 
    139139        7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 
    140140        7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 
    141141        7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 
    142142        7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 
    143143        7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919 
    144144        ]; 
    145145 
    146146        /********************************************************************* 
    147147 
    148148                Binary-chop search on sorted data. 
    149149 
    150150        *********************************************************************/ 
    151151 
    152152        private static int bsearch (in short[] array, short match) 
    153153        { 
    154154                int l, u, m; 
    155155                 
    156156                l = -1; 
    157                 u = array.length; 
     157                u = cast(int)array.length; 
    158158 
    159159                while (l+1 != u)  
    160160                      { 
    161161                      m = (l + u) / 2; 
    162162                      if (array[m] < match) 
    163163                          l = m; 
    164164                      else 
    165165                         u = m; 
    166166                      } 
    167167 
    168168               if (u >= array.length || array[u] != match) 
    169169                   return -u; 
    170170               return u; 
    171171        } 
    172172 
    173173        /********************************************************************** 
    174174 
    175175                return a prime number between 2 and 7919 (inclusive) that 
    176176                is equal to or larger than the given 'target' number.  
    177177 
  • trunk/test/runnable/interface2.d

    r666 r815  
    637637} 
    638638 
    639639class Child19 : ICov19, IFoo19 { 
    640640    Child19 covfunc() {  
    641641        printf("in Child19.covfunc()\n"); 
    642642        return this; 
    643643    } 
    644644} 
    645645 
    646646void test19() 
    647647{ 
    648648    Child19 c = new Child19(); 
    649649    ICov19 icov = c; 
    650650 
    651651    IFoo19 ifoo = icov.covfunc(); 
    652652 
    653653    printf("c = %p\n", c); 
    654654    printf("icov = %p\n", icov); 
    655655    printf("ifoo = %p\n", ifoo); 
    656656 
    657     assert(cast(void*)c + 8 == cast(void*)icov); 
    658     assert(cast(void*)c + 12 == cast(void*)ifoo); 
     657    assert(cast(void*)c + (2*(void*).sizeof) == cast(void*)icov); 
     658    assert(cast(void*)c + (3*(void*).sizeof) == cast(void*)ifoo); 
    659659 
    660660    string s = ifoo.classinfo.name; 
    661661    printf("%.*s\n", s.length, s.ptr); 
    662662    assert(s == "interface2.IFoo19"); 
    663663 
    664664    s = (cast(Object)ifoo).toString; 
    665665    printf("%.*s\n", s.length, s.ptr); 
    666666    assert(s == "interface2.Child19"); 
    667667} 
    668668 
    669669/*******************************************************/ 
    670670 
    671671interface Iface1 
    672672{ 
    673673    Iface2 func1(); 
    674674} 
    675675 
    676676interface Iface2 
    677677{ 
    678678    Iface1 func2(); 
  • trunk/test/runnable/lazy.d

    r574 r815  
     1import core.vararg; 
    12import std.stdio; 
    23 
    34/*********************************************************/ 
    45 
    56void ifthen(bool cond, lazy void dg) 
    67{ 
    78    if (cond) 
    89    dg(); 
    910} 
    1011 
    1112void ifthen(bool cond, lazy void dgthen, lazy void dgelse) 
    1213{ 
    1314    if (cond) 
    1415    dgthen(); 
    1516    else 
    1617    dgelse(); 
    1718} 
    1819 
    1920void dotimes(int i, lazy int dg) 
    2021{ 
     
    8283{ 
    8384    dg(); 
    8485} 
    8586 
    8687void test2() 
    8788{ 
    8889    fooa(cast(void)null); 
    8990} 
    9091 
    9192/*********************************************************/ 
    9293 
    9394void dotimes3(int count, lazy void exp) 
    9495{ 
    9596    for (int i = 0; i < count; i++) 
    9697       exp; 
    9798} 
    9899 
    99100void bar3(...) 
    100101{ 
    101102    assert(_arguments.length == 1); 
    102     assert(*cast(int *)_argptr == 14); 
     103    assert(va_arg!int(_argptr) == 14); 
    103104} 
    104105 
    105106void abc3(int* p) 
    106107{ 
    107108    writeln(*p); 
    108109    assert(*p == 3); 
    109110} 
    110111 
    111112void test3() 
    112113{ 
    113114 
    114115    int x = 3; 
    115116    dotimes3(10, abc3(&x)); 
    116117    dotimes3(10, write(++x)); 
    117118    writeln(); 
    118119    dotimes3(1, bar3(++x)); 
    119120 
    120121    int[10] a = new int[10]; 
    121122    a[0] = 1; 
    122123    a[$ - 1] = 9; 
     
    152153/*********************************************************/ 
    153154 
    154155bool nextis(void delegate() dgpositive = {}) 
    155156{ 
    156157        return true; 
    157158} 
    158159 
    159160bool looping(lazy bool condition) 
    160161{ 
    161162        return true; 
    162163} 
    163164 
    164165void test5() 
    165166{ 
    166167        looping(nextis({})); 
    167168        looping(nextis({})); 
    168169} 
    169170 
    170171/*********************************************************/ 
    171172 
    172 alias void* va_list; 
    173  
    174 template va_arg(T) 
    175 
    176     T va_arg(ref va_list _argptr) 
    177     { 
    178     T arg = *cast(T*)_argptr; // original from Phobos 
    179     _argptr = _argptr + ((T.sizeof + int.sizeof - 1) & ~(int.sizeof - 1)); 
    180     return arg; 
    181     } 
    182 
    183  
    184  
    185 void foo6(lazy int expr, ...){ 
     173void foo6(lazy int expr, ...) 
     174
    186175    char[] tmp_msg = va_arg!(char[])(_argptr); 
    187176    if (cast(int)(tmp_msg.ptr)=="food_for_thought".length) 
    188177         assert(0, "length is in the pointer!"); 
    189178    assert(tmp_msg=="food_for_thought"); 
    190179 
    191180} 
    192181 
    193182int bar6() { return 3; } 
    194183 
    195184void test6() 
    196185{ 
    197186  foo6(bar6(),"food_for_thought"); 
    198187} 
    199188 
    200189/*********************************************************/ 
    201190 
    202191int main() 
    203192{ 
    204193    test1(); 
    205194    test2(); 
  • trunk/test/runnable/opover2.d

    r574 r815  
    11 
    22// Test operator overloading 
    33 
    44import std.c.stdio; 
    55 
    66/**************************************/ 
    77 
    88class A 
    99{ 
    1010    string opUnary(string s)() 
    1111    { 
    12     printf("A.opUnary!(%.*s)\n", s); 
     12    printf("A.opUnary!(%.*s)\n", s.length, s.ptr); 
    1313    return s; 
    1414    } 
    1515} 
    1616 
    1717void test1() 
    1818{ 
    1919    auto a = new A(); 
    2020 
    2121    +a; 
    2222    -a; 
    2323    ~a; 
    2424    *a; 
    2525    ++a; 
    2626    --a; 
    2727 
    2828    auto x = a++; 
    2929    assert(x == a); 
    3030    auto y = a--; 
    3131    assert(y == a); 
    3232} 
    3333 
    3434/**************************************/ 
    3535 
    3636class A2 
    3737{ 
    3838    T opCast(T)() 
    3939    { 
    40     printf("A.opCast!(%.*s)\n", T.stringof); 
     40        auto s = T.stringof; 
     41    printf("A.opCast!(%.*s)\n", s.length, s.ptr); 
    4142    return T.init; 
    4243    } 
    4344} 
    4445 
    4546 
    4647void test2() 
    4748{ 
    4849    auto a = new A2(); 
    4950 
    5051    auto x = cast(int)a; 
    5152    assert(x == 0); 
    5253 
    5354    typedef int myint = 7; 
    5455    auto y = cast(myint)a; 
    5556    assert(y == 7); 
    5657} 
    5758 
    5859/**************************************/ 
    5960 
    6061struct A3 
    6162{ 
    6263    int opBinary(string s)(int i) 
    6364    { 
    64     printf("A.opBinary!(%.*s)\n", s); 
     65    printf("A.opBinary!(%.*s)\n", s.length, s.ptr); 
    6566    return 0; 
    6667    } 
    6768 
    6869    int opBinaryRight(string s)(int i) if (s == "/" || s == "*") 
    6970    { 
    70     printf("A.opBinaryRight!(%.*s)\n", s); 
     71    printf("A.opBinaryRight!(%.*s)\n", s.length, s.ptr); 
    7172    return 0; 
    7273    } 
    7374 
    7475    T opCast(T)() 
    7576    { 
    76     printf("A.opCast!(%.*s)\n", T.stringof); 
     77        auto s = T.stringof; 
     78    printf("A.opCast!(%.*s)\n", s.length, s.ptr); 
    7779    return T.init; 
    7880    } 
    7981} 
    8082 
    8183 
    8284void test3() 
    8385{ 
    8486    A3 a; 
    8587 
    8688    a + 3; 
    8789    4 * a; 
    8890    4 / a; 
    8991    a & 5; 
    9092} 
    9193 
    9294/**************************************/ 
    9395 
    9496struct A4 
    9597{ 
    9698    int opUnary(string s)() 
    9799    { 
    98     printf("A.opUnary!(%.*s)\n", s); 
     100    printf("A.opUnary!(%.*s)\n", s.length, s.ptr); 
    99101    return 0; 
    100102    } 
    101103 
    102104    T opCast(T)() 
    103105    { 
    104     printf("A.opCast!(%.*s)\n", T.stringof); 
     106        auto s = T.stringof; 
     107    printf("A.opCast!(%.*s)\n", s.length, s.ptr); 
    105108    return T.init; 
    106109    } 
    107110} 
    108111 
    109112 
    110113void test4() 
    111114{ 
    112115    A4 a; 
    113116 
    114117    if (a) 
    115118    int x = 3; 
    116119    if (!a) 
    117120    int x = 3; 
    118121    if (!!a) 
    119122    int x = 3; 
    120123} 
    121124 
    122125/**************************************/ 
    123126 
    124127class A5 
    125128{ 
    126129    bool opEquals(Object o) 
    127130    { 
    128131    printf("A.opEquals!(%p)\n", o); 
    129132    return 1; 
    130133    } 
    131134 
    132135    int opUnary(string s)() 
    133136    { 
    134     printf("A.opUnary!(%.*s)\n", s); 
     137    printf("A.opUnary!(%.*s)\n", s.length, s.ptr); 
    135138    return 0; 
    136139    } 
    137140 
    138141    T opCast(T)() 
    139142    { 
    140     printf("A.opCast!(%.*s)\n", T.stringof); 
     143        auto s = T.stringof; 
     144    printf("A.opCast!(%.*s)\n", s.length, s.ptr); 
    141145    return T.init; 
    142146    } 
    143147} 
    144148 
    145149class B5 : A5 
    146150{ 
    147151    bool opEquals(Object o) 
    148152    { 
    149153    printf("B.opEquals!(%p)\n", o); 
    150154    return 1; 
    151155    } 
    152156} 
    153157 
    154158 
    155159void test5() 
    156160{ 
    157161    A5 a = new A5(); 
    158162    A5 a2 = new A5(); 
    159163    B5 b = new B5(); 
    160164    A n = null; 
     
    264268    S7 s2; 
    265269 
    266270    if (s1 < s2) 
    267271    int x = 3; 
    268272 
    269273    T7 t; 
    270274 
    271275    if (s1 < t) 
    272276    int x = 3; 
    273277 
    274278    if (t < s2) 
    275279    int x = 3; 
    276280} 
    277281 
    278282/**************************************/ 
    279283 
    280284struct A8 
    281285{ 
    282286    int opUnary(string s)() 
    283287    { 
    284     printf("A.opUnary!(%.*s)\n", s); 
     288    printf("A.opUnary!(%.*s)\n", s.length, s.ptr); 
    285289    return 0; 
    286290    } 
    287291 
    288292    int opIndexUnary(string s, T)(T i) 
    289293    { 
    290     printf("A.opIndexUnary!(%.*s)(%d)\n", s, i); 
     294    printf("A.opIndexUnary!(%.*s)(%d)\n", s.length, s.ptr, i); 
    291295    return 0; 
    292296    } 
    293297 
    294298    int opIndexUnary(string s, T)(T i, T j) 
    295299    { 
    296     printf("A.opIndexUnary!(%.*s)(%d, %d)\n", s, i, j); 
     300    printf("A.opIndexUnary!(%.*s)(%d, %d)\n", s.length, s.ptr, i, j); 
    297301    return 0; 
    298302    } 
    299303 
    300304    int opSliceUnary(string s)() 
    301305    { 
    302     printf("A.opSliceUnary!(%.*s)()\n", s); 
     306    printf("A.opSliceUnary!(%.*s)()\n", s.length, s.ptr); 
    303307    return 0; 
    304308    } 
    305309 
    306310    int opSliceUnary(string s, T)(T i, T j) 
    307311    { 
    308     printf("A.opSliceUnary!(%.*s)(%d, %d)\n", s, i, j); 
     312    printf("A.opSliceUnary!(%.*s)(%d, %d)\n", s.length, s.ptr, i, j); 
    309313    return 0; 
    310314    } 
    311315} 
    312316 
    313317 
    314318void test8() 
    315319{ 
    316320    A8 a; 
    317321 
    318322    -a; 
    319323    -a[3]; 
    320324    -a[3, 4]; 
    321325    -a[]; 
    322326    -a[5 .. 6]; 
    323327    --a[3]; 
    324328} 
    325329 
    326330/**************************************/ 
    327331 
    328332struct A9 
    329333{ 
    330334    int opOpAssign(string s)(int i) 
    331335    { 
    332     printf("A.opOpAssign!(%.*s)\n", s); 
     336    printf("A.opOpAssign!(%.*s)\n", s.length, s.ptr); 
    333337    return 0; 
    334338    } 
    335339 
    336340    int opIndexOpAssign(string s, T)(int v, T i) 
    337341    { 
    338     printf("A.opIndexOpAssign!(%.*s)(%d, %d)\n", s, v, i); 
     342    printf("A.opIndexOpAssign!(%.*s)(%d, %d)\n", s.length, s.ptr, v, i); 
    339343    return 0; 
    340344    } 
    341345 
    342346    int opIndexOpAssign(string s, T)(int v, T i, T j) 
    343347    { 
    344     printf("A.opIndexOpAssign!(%.*s)(%d, %d, %d)\n", s, v, i, j); 
     348    printf("A.opIndexOpAssign!(%.*s)(%d, %d, %d)\n", s.length, s.ptr, v, i, j); 
    345349    return 0; 
    346350    } 
    347351 
    348352    int opSliceOpAssign(string s)(int v) 
    349353    { 
    350     printf("A.opSliceOpAssign!(%.*s)(%d)\n", s, v); 
     354    printf("A.opSliceOpAssign!(%.*s)(%d)\n", s.length, s.ptr, v); 
    351355    return 0; 
    352356    } 
    353357 
    354358    int opSliceOpAssign(string s, T)(int v, T i, T j) 
    355359    { 
    356     printf("A.opSliceOpAssign!(%.*s)(%d, %d, %d)\n", s, v, i, j); 
     360    printf("A.opSliceOpAssign!(%.*s)(%d, %d, %d)\n", s.length, s.ptr, v, i, j); 
    357361    return 0; 
    358362    } 
    359363} 
    360364 
    361365 
    362366void test9() 
    363367{ 
    364368    A9 a; 
    365369 
    366370    a += 8; 
    367371    a -= 8; 
    368372    a *= 8; 
    369373    a /= 8; 
    370374    a %= 8; 
    371375    a &= 8; 
    372376    a |= 8; 
    373377    a ^= 8; 
    374378    a <<= 8; 
    375379    a >>= 8; 
    376380    a >>>= 8; 
  • trunk/test/runnable/sdtor.d

    r653 r815  
    11 
     2import core.vararg; 
    23import std.c.stdio; 
    34 
    45int sdtor; 
    56 
    67struct S 
    78{ 
    89    ~this() { printf("~S()\n"); sdtor++; } 
    910} 
    1011 
    1112/**********************************/ 
    1213 
    1314void test1() 
    1415{ 
    1516    S* s = new S(); 
    1617    delete s; 
    1718    assert(sdtor == 1); 
    1819} 
    1920 
    2021/**********************************/ 
    2122 
  • trunk/test/runnable/test15.d

    r749 r815  
    11// REQUIRED_ARGS: -d 
    22 
    33import core.stdc.math; 
     4import core.vararg; 
    45import std.math: rndtol; 
    56import std.stream: File; 
    67import std.string; 
    78 
    89extern (C) 
    910{ 
    1011    int printf(const char*, ...); 
    1112} 
    1213 
    1314void test1() 
    1415{ 
    1516    int i; 
    1617    bool[] b = new bool[10]; 
    1718    for (i = 0; i < 10; i++) 
    1819    assert(b[i] == false); 
    1920 
    2021    typedef bool tbit = true; 
    2122    tbit[] tb = new tbit[63]; 
    2223    for (i = 0; i < 63; i++) 
    2324    assert(tb[i] == true); 
     
    8687 
    8788void test6() 
    8889{ 
    8990    assert('\x12'.sizeof == 1); 
    9091    assert('\u1234'.sizeof == 2); 
    9192    assert('\U00105678'.sizeof == 4); 
    9293 
    9394    assert('\x12' == 0x12); 
    9495    assert('\u1234' == 0x1234); 
    9596    assert('\U00105678' == 0x105678); 
    9697 
    9798    assert("abc\\def" == r"abc\def"); 
    9899} 
    99100 
    100101 
    101102/************************************/ 
    102103 
    103104void test7() 
    104105{ 
    105106    string s = `hello"there'you`; 
    106     printf("s = '%.*s'\n", s); 
     107    printf("s = '%.*s'\n", s.length, s.ptr); 
    107108    assert(s == "hello\"there'you"); 
    108109    ubyte[] b = cast(ubyte[])x"8B 7D f4 0d"; 
    109110    for (int i = 0; i < b.length; i++) 
    110111    printf("b[%d] = x%02x\n", i, b[i]); 
    111112    assert(b.length == 4); 
    112113    assert(b[0] == 0x8B); 
    113114    assert(b[1] == 0x7D); 
    114115    assert(b[2] == 0xF4); 
    115116    assert(b[3] == 0x0D); 
    116117} 
    117118 
    118119 
    119120/************************************/ 
    120121 
    121122 
    122123void foo8(out bool b) 
    123124{ 
    124125    b = true; 
    125126} 
    126127 
     
    319320    List2.rehash; 
    320321    } 
    321322  private: 
    322323    int delegate(in int arg1) List1[char[]]; 
    323324    int  List2[char []]; 
    324325} 
    325326 
    326327void test15() 
    327328{ 
    328329} 
    329330 
    330331 
    331332/************************************/ 
    332333 
    333334void test16() 
    334335{ 
    335336    char[] a=new char[0]; 
    336337    uint c = 200000; 
    337338    while (c--) 
    338339    a ~= 'x'; 
    339     //printf("a = '%.*s'\n", a); 
     340    //printf("a = '%.*s'\n", a.length, a.ptr); 
    340341} 
    341342 
    342343 
    343344/************************************/ 
    344345 
    345346class A17 { } 
    346347class B17 : A17 { } 
    347348 
    348349void foo17(A17[] a) { } 
    349350 
    350351void test17() 
    351352{ 
    352353    B17[] b; 
    353354    foo17(b); 
    354355} 
    355356 
    356357 
    357358/************************************/ 
    358359 
    359360void test18() 
     
    467468 
    468469void test25() 
    469470{ 
    470471   new subbar25(); 
    471472} 
    472473 
    473474 
    474475/************************************/ 
    475476 
    476477void test26() 
    477478{ 
    478479    string[] instructions = std.string.split("a;b;c", ";"); 
    479480 
    480481    foreach(ref string instr; instructions) 
    481482    { 
    482483    std.string.strip(instr); 
    483484    } 
    484485 
    485486    foreach(string instr; instructions) 
    486487    { 
    487     printf("%.*s\n", instr); 
     488    printf("%.*s\n", instr.length, instr.ptr); 
    488489    } 
    489490} 
    490491 
    491492 
    492493/************************************/ 
    493494 
    494495void foo27(ClassInfo ci) { } 
    495496 
    496497class A27 
    497498{ 
    498499} 
    499500 
    500501class B27 : A27 
    501502{ 
    502503    static this() 
    503504    { 
    504505    foo27(B27.classinfo); 
    505506    foo27(A27.classinfo); 
    506507    } 
    507508} 
    508509 
    509510void test27() 
    510511{ 
    511512} 
    512513 
    513514 
    514515/************************************/ 
    515516 
    516517void foo28(ClassInfo ci) 
    517518{ 
    518     printf("%.*s\n", ci.name ); 
     519    printf("%.*s\n", ci.name.length, ci.name.ptr); 
    519520 
    520521    static int i; 
    521522    switch (i++) 
    522523    { 
    523524    case 0: 
    524525    case 2: assert(ci.name == "test15.A28"); 
    525526        break; 
    526527    case 1: assert(ci.name == "test15.B28"); 
    527528        break; 
    528529    } 
    529530} 
    530531 
    531532class A28 
    532533{ 
    533534    static this() { 
    534535    foo28(A28.classinfo ); 
    535536    } 
    536537} 
    537538 
    538539class B28 : A28 
     
    879880    return a.foo; 
    880881} 
    881882 
    882883void test43() 
    883884{ 
    884885    A43 a = new A43(); 
    885886    assert(bar43(a) == 6); 
    886887} 
    887888 
    888889 
    889890/************************************/ 
    890891 
    891892class C44 
    892893{ 
    893894    const char[][] arrArr=["foo"]; 
    894895} 
    895896 
    896897void test44() 
    897898{ 
    898899  C44 c= new C44(); 
    899   printf("%.*s\n", c.arrArr[0]); 
     900  printf("%.*s\n", c.arrArr[0].length, c.arrArr[0].ptr); 
    900901  assert(c.arrArr[0] == "foo"); 
    901902} 
    902903 
    903904 
    904905/************************************/ 
    905906 
    906907void test45() 
    907908{ 
    908909    void* p; 
    909910    void[] data; 
    910911 
    911912    data = p[0 .. 5]; 
    912913} 
    913914 
    914915/************************************/ 
    915916 
    916917union A46 
    917918{ 
    918919    char c; 
    919920    struct { short s; } 
     
    11411142 
    11421143class Foo56 
    11431144{ 
    11441145    alias int baseType; 
    11451146} 
    11461147 
    11471148void test56() 
    11481149{ 
    11491150    Foo56 f = new Foo56; 
    11501151 
    11511152    f.baseType s = 10; 
    11521153} 
    11531154 
    11541155 
    11551156/************************************/ 
    11561157 
    11571158void det(float mat[][]) 
    11581159{ 
    11591160    float newmat[][]; 
    11601161 
    1161     int i = newmat[0 .. (mat.length - 1)].length; 
     1162    size_t i = newmat[0 .. (mat.length - 1)].length; 
    11621163} 
    11631164 
    11641165void test57() 
    11651166{ 
    11661167} 
    11671168 
    11681169 
    11691170/************************************/ 
    11701171 
    11711172int foo58 (int a, int t) { return 2; } 
    11721173 
    11731174class A58 
    11741175{ 
    11751176    int foo58 ( ) { return 3; } 
    11761177    alias .foo58 foo58; 
    11771178} 
    11781179 
    11791180void test58() 
    11801181{   int y, x; 
    11811182 
     
    12181219void test60() 
    12191220{ 
    12201221    Foo60 f = new Foo60(); 
    12211222 
    12221223    assert(f.x == 3); 
    12231224} 
    12241225 
    12251226 
    12261227/************************************/ 
    12271228 
    12281229class StdString 
    12291230{ 
    12301231     alias std.string.toString toString; 
    12311232} 
    12321233 
    12331234void test61() 
    12341235{ 
    12351236    int i = 123; 
    12361237    StdString g = new StdString(); 
    12371238    string s = g.toString(i); 
    1238     printf("%.*s\n", s); 
     1239    printf("%.*s\n", s.length, s.ptr); 
    12391240    assert(s == "123"); 
    12401241} 
    12411242 
    12421243 
    12431244/************************************/ 
    12441245 
    12451246void test62() 
    12461247{   char[4] a; 
    12471248 
    12481249    assert(a[0] == 0xFF); 
    12491250    assert(a[1] == 0xFF); 
    12501251    assert(a[2] == 0xFF); 
    12511252    assert(a[3] == 0xFF); 
    12521253} 
    12531254 
    12541255 
    12551256/************************************/ 
    12561257 
    12571258void test63() 
    12581259{ 
  • trunk/test/runnable/test20.d

    r666 r815  
     1import core.vararg; 
    12 
    23extern(C) int printf(const char*, ...); 
    34 
    45/*****************************************/ 
    56 
    67class A1 
    78{ 
    89    union 
    910    { 
    1011        struct 
    1112    { 
    1213            int x; 
    1314            public int y; 
    1415        } 
    1516        protected int z; 
    1617    } 
    1718} 
    1819 
    1920class A2 
    2021{ 
     
    368369 
    369370void abc17(ref ubyte[16] bar) 
    370371{ 
    371372    printf("bar = %p\n", bar.ptr); 
    372373    assert(bar.ptr == ptr17); 
    373374} 
    374375 
    375376/*****************************************/ 
    376377 
    377378struct Iterator18(T) 
    378379{ 
    379380   T* m_ptr; 
    380381 
    381382   const bool opEquals(const ref Iterator18 iter) 
    382383   { 
    383384     return (m_ptr == iter.m_ptr); 
    384385   } 
    385386 
    386387   const int opCmp(const ref Iterator18 iter) 
    387388   { 
    388      return (m_ptr - iter.m_ptr); 
     389     return cast(int)(m_ptr - iter.m_ptr); 
    389390   } 
    390391} 
    391392 
    392393void test18() 
    393394{ 
    394395    Iterator18!(int) iter; 
    395396} 
    396397 
    397398/*****************************************/ 
    398399 
    399400struct S29(T) 
    400401{ 
    401402   const bool opEquals(const ref S29!(T) len2) 
    402403   { 
    403404     return 0; 
    404405   } 
    405406 
    406407   const int opCmp(const ref S29!(T) len2) 
    407408   { 
    408409     return 0; 
  • trunk/test/runnable/testdate.d

    r575 r815  
    113113    { "Wed, 2 Nov 1994 00:00:55 -0600 (CST)" , 783756055 }, 
    114114    { "Sun, 6 Nov 1994 01:19:13 -0600 (CST)" , 784106353 }, 
    115115    { "Mon, 7 Nov 1994 23:16:57 -0600 (CST)" , 784271817 }, 
    116116    { "Tue, 08 Nov 1994 13:21:21 -0600"      , 784322481 }, 
    117117    { "Mon, 07 Nov 94 13:47:37 PST"          , 784244857 }, 
    118118    { "Tue, 08 Nov 94 11:23:19 PST"          , 784322599 }, 
    119119    { "Tue, 01 Nov 1994 11:28:25 -0800"      , 783718105 }, 
    120120    { "Tue, 15 Nov 1994 13:11:47 -0800"      , 784933907 }, 
    121121    { "Tue, 15 Nov 1994 13:18:38 -0800"      , 784934318 }, 
    122122    { "Tue, 15 Nov 1994 0:18:38 -0800"       , 784887518 }, 
    123123]; 
    124124 
    125125void test1() 
    126126{ 
    127127    d_time d; 
    128128    string s; 
    129129 
    130130    d = std.date.getUTCtime(); 
    131131    printf("d = %lld\n", d); 
    132132    s = std.date.toString(d); 
    133     printf("s = %.*s\n", s); 
     133    printf("s = %.*s\n", s.length, s.ptr); 
    134134    s = std.date.toDateString(d); 
    135     printf("s = %.*s\n", s); 
     135    printf("s = %.*s\n", s.length, s.ptr); 
    136136    s = std.date.toTimeString(d); 
    137     printf("s = %.*s\n\n", s); 
     137    printf("s = %.*s\n\n", s.length, s.ptr); 
    138138 
    139139  version (OSX) 
    140140  { 
    141141    // don't do the test because the timezone on my Mac box is off 
    142142    // by an hour for some reason 
    143143    int i = 1; 
    144144  } 
    145145  else 
    146146    int i = 0; 
    147147 
    148148    for (; i < testvectors.length; i++) 
    149149    { 
    150150    s = testvectors[i].str; 
    151151    d = std.date.parse(s); 
    152     printf("%.*s = %lld, should be %lld\n", s, d, testvectors[i].value * ticksPerSecond); 
     152    printf("%.*s = %lld, should be %lld\n", s.length, s.ptr, d, testvectors[i].value * ticksPerSecond); 
    153153 
    154154    s = std.date.toString(d); 
    155     printf("s = %.*s\n\n", s); 
     155    printf("s = %.*s\n\n", s.length, s.ptr); 
    156156 
    157157    assert(d == testvectors[i].value * ticksPerSecond); 
    158158    } 
    159159} 
    160160 
    161161/**********************************************/ 
    162162 
    163163void test2() 
    164164{ 
    165165    string fecha= toDateString(getUTCtime()); 
    166     printf("%.*s\n",fecha); 
     166    printf("%.*s\n", fecha.length, fecha.ptr); 
    167167} 
    168168 
    169169/**********************************************/ 
    170170 
    171171void test3() 
    172172{ 
    173173    auto time = parse("Jan 1"); 
    174174    assert(time == d_time_nan); 
    175175    time = UTCtoLocalTime(time); //  Line 11 
    176176    assert(time == d_time_nan); 
    177177    auto str = toUTCString(time); // Line 12 
    178178    writefln(`"%s" = %s (%s)`, "Jan 1", time, str); 
    179179} 
    180180 
    181181/**********************************************/ 
    182182 
    183183int main() 
    184184{ 
    185185    test1(); 
    186186    test2(); 
  • trunk/test/runnable/testdstress.d

    r806 r815  
    11// PERMUTE_ARGS: 
    22 
    33module dstress.run.module_01; 
    44 
    55import core.memory; 
    66import core.exception; 
     7import core.vararg; 
    78 
    89extern(C) void* malloc(size_t size); 
    910 
    1011/* ================================ */ 
    1112 
    1213struct MyStruct 
    1314{ 
    1415    int i; 
    1516} 
    1617 
    1718void test1() 
    1819{ 
    1920    MyStruct inner() 
    2021    in{ 
    2122        assert(1); 
    2223    }out (result){ 
    2324        assert(result.i==1); 
    2425    }body{ 
    2526        MyStruct s; 
    2627        s.i = 1; 
  • trunk/test/runnable/testtypeid.d

    r575 r815  
    11 
     2import core.vararg; 
    23import std.stdio; 
    34 
    45/******************************************************/ 
    56 
    67class ABC { } 
    78 
    89typedef ABC DEF; 
    910 
    1011TypeInfo foo() 
    1112{ 
    1213    ABC c; 
    1314 
    1415    return typeid(DEF); 
    1516} 
    1617 
    1718void test1() 
    1819{ 
    1920    TypeInfo ti = foo(); 
    2021 
    2122    TypeInfo_Typedef td = cast(TypeInfo_Typedef)ti; 
    2223    assert(td); 
    2324 
    2425    ti = td.base; 
    2526 
    2627    TypeInfo_Class tc = cast(TypeInfo_Class)ti; 
    2728    assert(tc); 
    2829 
    29     printf("%.*s\n", tc.info.name); 
     30    printf("%.*s\n", tc.info.name.length, tc.info.name.ptr); 
    3031    assert(tc.info.name == "testtypeid.ABC"); 
    3132} 
    3233 
    3334/******************************************************/ 
    3435 
    3536void test2() 
    3637{ 
    3738    assert(typeid(int) == typeid(int)); 
    3839    assert(typeid(int) != typeid(uint)); 
    3940} 
    4041 
    4142/******************************************************/ 
    4243 
    4344class FOO3 { } 
    4445 
    4546FOO3 foox3; 
    4647 
    4748void foo3(int x, ...) 
    4849{ 
    4950    printf("%d arguments\n", _arguments.length); 
    5051    for (int i = 0; i < _arguments.length; i++) 
    5152    {   writeln(_arguments[i].toString()); 
    5253 
    5354    if (_arguments[i] is typeid(int)) 
    5455    { 
    55         int j = *cast(int *)_argptr; 
    56         _argptr += int.sizeof; 
     56        int j = va_arg!int(_argptr); 
    5757        printf("\t%d\n", j); 
    5858        assert(j == 2); 
    5959    } 
    6060    else if (_arguments[i] == typeid(long)) 
    6161    { 
    62         long j = *cast(long *)_argptr; 
    63         _argptr += long.sizeof; 
     62        long j = va_arg!long(_argptr); 
    6463        printf("\t%lld\n", j); 
    6564        assert(j == 3); 
    6665    } 
    6766    else if (_arguments[i] is typeid(double)) 
    6867    { 
    69         double d = *cast(double *)_argptr; 
    70         _argptr += double.sizeof; 
     68        double d = va_arg!double(_argptr); 
    7169        printf("\t%g\n", d); 
    7270        assert(d == 4.5); 
    7371    } 
    7472    else if (_arguments[i] is typeid(FOO3)) 
    7573    { 
    76         FOO3 f = *cast(FOO3*)_argptr; 
    77         _argptr += FOO3.sizeof; 
     74        FOO3 f = va_arg!FOO3(_argptr); 
    7875        printf("\t%p\n", f); 
    7976        assert(f is foox3); 
    8077    } 
    8178    else 
    8279        assert(0); 
    8380    } 
    8481} 
    8582 
    8683void test3() 
    8784{ 
    8885    FOO3 f = new FOO3(); 
    8986 
    9087    printf("\t%p\n", f); 
    9188    foox3 = f; 
    9289 
    9390    foo3(1,2,3L,4.5,f); 
    9491    foo3(1,2,3L,4.5,f); 
    9592} 
    9693 
    9794/******************************************************/ 
     
    405402{ 
    406403    TypeInfo ti = typeid(void); 
    407404    assert(!(ti is null)); 
    408405    assert(ti.tsize == void.sizeof); 
    409406    assert(ti.toString()=="void"); 
    410407} 
    411408 
    412409/******************************************************/ 
    413410 
    414411class Foo32 { int x = 3; } 
    415412class Bar32 { long y = 4; } 
    416413 
    417414void printargs(int x, ...) 
    418415{ 
    419416    printf("%d arguments\n", _arguments.length); 
    420417    for (int i = 0; i < _arguments.length; i++) 
    421418    {   writeln(_arguments[i].toString()); 
    422419 
    423420    if (_arguments[i] == typeid(int)) 
    424421    { 
    425         int j = *cast(int *)_argptr; 
    426         _argptr += int.sizeof; 
     422        int j = va_arg!int(_argptr); 
    427423        printf("\t%d\n", j); 
    428424    } 
    429425    else if (_arguments[i] == typeid(long)) 
    430426    { 
    431         long j = *cast(long *)_argptr; 
    432         _argptr += long.sizeof; 
     427        long j = va_arg!long(_argptr); 
    433428        printf("\t%lld\n", j); 
    434429    } 
    435430    else if (_arguments[i] == typeid(double)) 
    436431    { 
    437         double d = *cast(double *)_argptr; 
    438         _argptr += double.sizeof; 
     432        double d = va_arg!double(_argptr); 
    439433        printf("\t%g\n", d); 
    440434    } 
    441435    else if (_arguments[i] == typeid(Foo32)) 
    442436    { 
    443         Foo32 f = *cast(Foo32*)_argptr
     437        Foo32 f = va_arg!Foo32(_argptr)
    444438        assert(f.x == 3); 
    445         _argptr += Foo32.sizeof; 
    446439        printf("\t%p\n", f); 
    447440    } 
    448441    else if (_arguments[i] == typeid(Bar32)) 
    449442    { 
    450         Bar32 b = *cast(Bar32*)_argptr
     443        Bar32 b = va_arg!Bar32(_argptr)
    451444        assert(b.y == 4); 
    452         _argptr += Bar32.sizeof; 
    453445        printf("\t%p\n", b); 
    454446    } 
    455447    else 
    456448        assert(0); 
    457449    } 
    458450} 
    459451 
    460452void test32() 
    461453{ 
    462454    Foo32 f = new Foo32(); 
    463455    Bar32 b = new Bar32(); 
    464456 
    465457    printf("%p\n", f); 
    466458    printargs(1, 2, 3L, 4.5, f, b); 
    467459} 
    468460 
    469461/******************************************************/ 
    470462 
    471463void test33() 
    472464{