Changeset 599


Ignore:
Timestamp:
Aug 15, 2003, 11:49:10 PM (22 years ago)
Author:
bird
Message:

'Completed' the testcase.

Location:
trunk/testcase
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/testcase/570asm.s

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r598 r599  
    55.globl ExternCVoid
    66ExternCVoid:
    7    ret
     7   jmp verify
    88
    99.globl ExternCPVoid
    1010ExternCPVoid:
    11    ret
     11   jmp verify
    1212
    1313.globl ExternCInt
    1414ExternCInt:
    15    ret
     15   jmp verify
    1616
    1717.globl ExternCPType
    1818ExternCPType:
    19    ret
     19   jmp verify
    2020
    2121.globl Void
    2222Void:
    23    ret
     23   jmp verify
    2424
    2525.globl PVoid
    2626PVoid:
    27    ret
     27   jmp verify
    2828
    2929.globl Int
    3030Int:
    31    ret
     31   jmp verify
    3232
    3333.globl PType
    3434PType:
     35   jmp verify
     36
     37
     38.globl __ZN3foo16StaticMemberVoidEiiii
     39__ZN3foo16StaticMemberVoidEiiii:
     40   jmp verify
     41
     42.globl __ZN3foo17StaticMemberPVoidEiiii
     43__ZN3foo17StaticMemberPVoidEiiii:
     44   jmp verify
     45
     46.globl __ZN3foo15StaticMemberIntEiiii
     47__ZN3foo15StaticMemberIntEiiii:
     48   jmp verify
     49
     50.globl __ZN3foo17StaticMemberPTypeEiiii
     51__ZN3foo17StaticMemberPTypeEiiii:
     52   jmp verify
     53
     54
     55.globl __ZN3foo10MemberVoidEiiii
     56__ZN3foo10MemberVoidEiiii:
     57   jmp verify2
     58
     59.globl __ZN3foo11MemberPVoidEiiii
     60__ZN3foo11MemberPVoidEiiii:
     61   jmp verify2
     62
     63.globl __ZN3foo9MemberIntEiiii
     64__ZN3foo9MemberIntEiiii:
     65   jmp verify2
     66
     67.globl __ZN3foo11MemberPTypeEiiii
     68__ZN3foo11MemberPTypeEiiii:
     69   jmp verify2
     70
     71
     72
     73verify:
     74   pushl %ebp
     75   movl  %esp, %ebp
     76
     77   movl  8(%ebp), %eax
     78   cmpl  $1, %eax
     79   je    ok1
     80   int   $3
     81
     82ok1:
     83   movl  12(%ebp), %eax
     84   cmpl  $2, %eax
     85   je    ok2
     86   int   $3
     87
     88
     89ok2:
     90   movl  16(%ebp), %eax
     91   cmpl  $3, %eax
     92   je    ok3
     93   int   $3
     94
     95ok3:
     96   movl  20(%ebp), %eax
     97   cmpl  $4, %eax
     98   je    ok4
     99   int   $3
     100
     101ok4:
     102   mov   %ebp, %ebp
     103   popl  %ebp
    35104   ret
    36105
    37106
    38 .globl __ZN3foo16StaticMemberVoidEv
    39 __ZN3foo16StaticMemberVoidEv:
     107verify2:
     108   pushl %ebp
     109   movl  %esp, %ebp
     110
     111   movl  4(%ebp), %eax
     112   test   %eax, %eax
     113   jnz   okthis
     114   int   $3
     115
     116okthis:
     117   movl  12(%ebp), %eax
     118   cmpl  $1, %eax
     119   je    ok21
     120   int   $3
     121
     122ok21:
     123   movl  16(%ebp), %eax
     124   cmpl  $2, %eax
     125   je    ok22
     126   int   $3
     127
     128
     129ok22:
     130   movl  20(%ebp), %eax
     131   cmpl  $3, %eax
     132   je    ok23
     133   int   $3
     134
     135ok23:
     136   movl  24(%ebp), %eax
     137   cmpl  $4, %eax
     138   je    ok24
     139   int   $3
     140
     141ok24:
     142   mov   %ebp, %ebp
     143   popl  %ebp
    40144   ret
    41145
    42 .globl __ZN3foo17StaticMemberPVoidEv
    43 __ZN3foo17StaticMemberPVoidEv:
    44    ret
    45 
    46 .globl __ZN3foo15StaticMemberIntEv
    47 __ZN3foo15StaticMemberIntEv:
    48    ret
    49 
    50 .globl __ZN3foo17StaticMemberPTypeEv
    51 __ZN3foo17StaticMemberPTypeEv:
    52    ret
    53 
    54 .globl __ZN3foo10MemberVoidEv
    55 __ZN3foo10MemberVoidEv:
    56    ret
    57 
    58 .globl __ZN3foo11MemberPVoidEv
    59 __ZN3foo11MemberPVoidEv:
    60    ret
    61 
    62 .globl __ZN3foo9MemberIntEv
    63 __ZN3foo9MemberIntEv:
    64    ret
    65 
    66 .globl __ZN3foo11MemberPTypeEv
    67 __ZN3foo11MemberPTypeEv:
    68    ret
    69 
  • trunk/testcase/570c.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r598 r599  
    66 */
    77/* No underscore, No mangling. */
    8 void    _System             Void(void);
    9 void *  _System             PVoid(void);
    10 int     _System             Int(void);
    11 PTYPE   _System             PType(void);
     8void    _System             Void(int a, int b, int c, int d);
     9void *  _System             PVoid(int a, int b, int c, int d);
     10int     _System             Int(int a, int b, int c, int d);
     11PTYPE   _System             PType(int a, int b, int c, int d);
    1212
    1313/*
     
    1515 * Checks that there is not warnings on these.
    1616 */
    17 typedef void    _System     Typedef1Void(void);
    18 typedef void *  _System     Typedef1PVoid(void);
    19 typedef int     _System     Typedef1Int(void);
    20 typedef PTYPE   _System     Typedef1PType(void);
     17typedef void    _System     Typedef1Void(int a, int b, int c, int d);
     18typedef void *  _System     Typedef1PVoid(int a, int b, int c, int d);
     19typedef int     _System     Typedef1Int(int a, int b, int c, int d);
     20typedef PTYPE   _System     Typedef1PType(int a, int b, int c, int d);
    2121
    22 typedef void    (_System    Typedef2Void)(void);
    23 typedef void *  (_System    Typedef2PVoid)(void);
    24 typedef int     (_System    Typedef2Int)(void);
    25 typedef PTYPE   (_System    Typedef2PType)(void);
     22typedef void    (_System    Typedef2Void)(int a, int b, int c, int d);
     23typedef void *  (_System    Typedef2PVoid)(int a, int b, int c, int d);
     24typedef int     (_System    Typedef2Int)(int a, int b, int c, int d);
     25typedef PTYPE   (_System    Typedef2PType)(int a, int b, int c, int d);
    2626
    27 typedef void    (* _System  PTypedef1Void)(void);
    28 typedef void *  (* _System  PTypedef1PVoid)(void);
    29 typedef int     (* _System  PTypedef1Int)(void);
    30 typedef PTYPE   (* _System  PTypedef1PType)(void);
     27typedef void    (* _System  PTypedef1Void)(int a, int b, int c, int d);
     28typedef void *  (* _System  PTypedef1PVoid)(int a, int b, int c, int d);
     29typedef int     (* _System  PTypedef1Int)(int a, int b, int c, int d);
     30typedef PTYPE   (* _System  PTypedef1PType)(int a, int b, int c, int d);
    3131
    3232/* Alternate writing which should have the same effect I think... */
    33 typedef void    (_System *  PTypedef2Void)(void);
    34 typedef void *  (_System *  PTypedef2PVoid)(void);
    35 typedef int     (_System *  PTypedef2Int)(void);
    36 typedef PTYPE   (_System *  PTypedef2PType)(void);
     33typedef void    (_System *  PTypedef2Void)(int a, int b, int c, int d);
     34typedef void *  (_System *  PTypedef2PVoid)(int a, int b, int c, int d);
     35typedef int     (_System *  PTypedef2Int)(int a, int b, int c, int d);
     36typedef PTYPE   (_System *  PTypedef2PType)(int a, int b, int c, int d);
    3737
    3838
     
    4242typedef struct VFT
    4343{
    44     void    (_System *  PStructMemberVoid)(void* pvThis);
    45     void *  (_System *  PStructMemberPVoid)(void* pvThis);
    46     int     (_System *  PStructMemberInt)(void* pvThis);
    47     PTYPE   (_System *  PStructMemberPType)(void* pvThis);
     44    void    (_System *  PStructMemberVoid)(int a, int b, int c, int d);
     45    void *  (_System *  PStructMemberPVoid)(int a, int b, int c, int d);
     46    int     (_System *  PStructMemberInt)(int a, int b, int c, int d);
     47    PTYPE   (_System *  PStructMemberPType)(int a, int b, int c, int d);
    4848
    4949    /* Alternate writing which should have the same effect I think... */
    50     void    ( _System * PStructMember2Void)(void* pvThis);
    51     void *  ( _System * PStructMember2PVoid)(void* pvThis);
    52     int     ( _System * PStructMember2Int)(void* pvThis);
    53     PTYPE   ( _System * PStructMember2PType)(void* pvThis);
     50    void    ( _System * PStructMember2Void)(int a, int b, int c, int d);
     51    void *  ( _System * PStructMember2PVoid)(int a, int b, int c, int d);
     52    int     ( _System * PStructMember2Int)(int a, int b, int c, int d);
     53    PTYPE   ( _System * PStructMember2PType)(int a, int b, int c, int d);
    5454
    5555} VFT, *PVFT;
    5656
    5757
    58 int DoC(void)
     58int DoC(int a, int b, int c, int d)
    5959{
    60     VFT vft = {0,0,0,0};
     60    VFT vft = {Void, PVoid, Int, PType,
     61               Void, PVoid, Int, PType};
    6162
    62     Void();
    63     PVoid();
    64     Int();
    65     PType();
     63    Typedef1Void       * pfnTypedef1Void   = Void;
     64    Typedef1PVoid      * pfnTypedef1PVoid  = PVoid;
     65    Typedef1Int        * pfnTypedef1Int    = Int;
     66    Typedef1PType      * pfnTypedef1PType  = PType;
    6667
    67     if (vft.PStructMemberVoid)
    68         vft.PStructMemberVoid(&vft);
    69     if (vft.PStructMemberPVoid)
    70         vft.PStructMemberPVoid(&vft);
    71     if (vft.PStructMemberInt)
    72         vft.PStructMemberInt(&vft);
    73     if (vft.PStructMemberPType)
    74         vft.PStructMemberPType(&vft);
     68    Typedef2Void       * pfnTypedef2Void   = Void;
     69    Typedef2PVoid      * pfnTypedef2PVoid  = PVoid;
     70    Typedef2Int        * pfnTypedef2Int    = Int;
     71    Typedef2PType      * pfnTypedef2PType  = PType;
     72
     73    PTypedef1Void        pfnPTypedef1Void  = Void;
     74    PTypedef1PVoid       pfnPTypedef1PVoid = PVoid;
     75    PTypedef1Int         pfnPTypedef1Int   = Int;
     76    PTypedef1PType       pfnPTypedef1PType = PType;
     77
     78    PTypedef2Void        pfnPTypedef2Void  = Void;
     79    PTypedef2PVoid       pfnPTypedef2PVoid = PVoid;
     80    PTypedef2Int         pfnPTypedef2Int   = Int;
     81    PTypedef2PType       pfnPTypedef2PType = PType;
     82
     83
     84    /* extern functions */
     85    Void(1,2,3,4);
     86    PVoid(1,2,3,4);
     87    Int(1,2,3,4);
     88    PType(1,2,3,4);
     89
     90    /* typedefs */
     91    pfnTypedef1Void(1,2,3,4);
     92    pfnTypedef1PVoid(1,2,3,4);
     93    pfnTypedef1Int(1,2,3,4);
     94    pfnTypedef1PType(1,2,3,4);
     95
     96    pfnTypedef2Void(1,2,3,4);
     97    pfnTypedef2PVoid(1,2,3,4);
     98    pfnTypedef2Int(1,2,3,4);
     99    pfnTypedef2PType(1,2,3,4);
     100
     101    pfnPTypedef1Void(1,2,3,4);
     102    pfnPTypedef1PVoid(1,2,3,4);
     103    pfnPTypedef1Int(1,2,3,4);
     104    pfnPTypedef1PType(1,2,3,4);
     105
     106    pfnPTypedef2Void(1,2,3,4);
     107    pfnPTypedef2PVoid(1,2,3,4);
     108    pfnPTypedef2Int(1,2,3,4);
     109    pfnPTypedef2PType(1,2,3,4);
     110
     111
     112    /* structs */
     113    vft.PStructMemberVoid(1,2,3,4);
     114    vft.PStructMemberPVoid(1,2,3,4);
     115    vft.PStructMemberInt(1,2,3,4);
     116    vft.PStructMemberPType(1,2,3,4);
     117
     118    vft.PStructMember2Void(1,2,3,4);
     119    vft.PStructMember2PVoid(1,2,3,4);
     120    vft.PStructMember2Int(1,2,3,4);
     121    vft.PStructMember2PType(1,2,3,4);
    75122
    76123    return 0;
  • trunk/testcase/570main.cpp

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r598 r599  
    77
    88/* No underscore, No mangling. */
    9 extern "C" void   _System   ExternCVoid(void);
    10 extern "C" void * _System   ExternCPVoid(void);
    11 extern "C" int    _System   ExternCInt(void);
    12 extern "C" PTYPE  _System   ExternCPType(void);
     9extern "C" void   _System   ExternCVoid(int a, int b, int c, int d);
     10extern "C" void * _System   ExternCPVoid(int a, int b, int c, int d);
     11extern "C" int    _System   ExternCInt(int a, int b, int c, int d);
     12extern "C" PTYPE  _System   ExternCPType(int a, int b, int c, int d);
    1313
    1414/* No underscore, No mangling. */
    15 void    _System             Void(void);
    16 void *  _System             PVoid(void);
    17 int     _System             Int(void);
    18 PTYPE   _System             PType(void);
     15void    _System             Void(int a, int b, int c, int d);
     16void *  _System             PVoid(int a, int b, int c, int d);
     17int     _System             Int(int a, int b, int c, int d);
     18PTYPE   _System             PType(int a, int b, int c, int d);
    1919
    2020
     
    2323{
    2424public:
    25 static void    _System      StaticMemberVoid(void);
    26 static void *  _System      StaticMemberPVoid(void);
    27 static int     _System      StaticMemberInt(void);
    28 static PTYPE   _System      StaticMemberPType(void);
     25static void    _System      StaticMemberVoid(int a, int b, int c, int d);
     26static void *  _System      StaticMemberPVoid(int a, int b, int c, int d);
     27static int     _System      StaticMemberInt(int a, int b, int c, int d);
     28static PTYPE   _System      StaticMemberPType(int a, int b, int c, int d);
    2929
    3030/* VAC365 allows this too, and actually mangles the
     
    3434 * We don't need to support this, it's just a curiosity.
    3535 */
    36 void           _System      MemberVoid(void);
    37 void *         _System      MemberPVoid(void);
    38 int            _System      MemberInt(void);
    39 PTYPE          _System      MemberPType(void);
     36void           _System      MemberVoid(int a, int b, int c, int d);
     37void *         _System      MemberPVoid(int a, int b, int c, int d);
     38int            _System      MemberInt(int a, int b, int c, int d);
     39PTYPE          _System      MemberPType(int a, int b, int c, int d);
    4040};
    4141
     
    4545 * Checks that there is not warnings on these.
    4646 */
    47 typedef void    _System     Typedef1Void(void);
    48 typedef void *  _System     Typedef1PVoid(void);
    49 typedef int     _System     Typedef1Int(void);
    50 typedef PTYPE   _System     Typedef1PType(void);
     47typedef void    _System     Typedef1Void(int a, int b, int c, int d);
     48typedef void *  _System     Typedef1PVoid(int a, int b, int c, int d);
     49typedef int     _System     Typedef1Int(int a, int b, int c, int d);
     50typedef PTYPE   _System     Typedef1PType(int a, int b, int c, int d);
    5151
    52 typedef void    (_System    Typedef2Void)(void);
    53 typedef void *  (_System    Typedef2PVoid)(void);
    54 typedef int     (_System    Typedef2Int)(void);
    55 typedef PTYPE   (_System    Typedef2PType)(void);
     52typedef void    (_System    Typedef2Void)(int a, int b, int c, int d);
     53typedef void *  (_System    Typedef2PVoid)(int a, int b, int c, int d);
     54typedef int     (_System    Typedef2Int)(int a, int b, int c, int d);
     55typedef PTYPE   (_System    Typedef2PType)(int a, int b, int c, int d);
    5656
    57 typedef void    (* _System  PTypedef1Void)(void);
    58 typedef void *  (* _System  PTypedef1PVoid)(void);
    59 typedef int     (* _System  PTypedef1Int)(void);
    60 typedef PTYPE   (* _System  PTypedef1PType)(void);
     57typedef void    (* _System  PTypedef1Void)(int a, int b, int c, int d);
     58typedef void *  (* _System  PTypedef1PVoid)(int a, int b, int c, int d);
     59typedef int     (* _System  PTypedef1Int)(int a, int b, int c, int d);
     60typedef PTYPE   (* _System  PTypedef1PType)(int a, int b, int c, int d);
    6161
    6262/* Alternate writing which should have the same effect I think... */
    63 typedef void    (_System *  PTypedef2Void)(void);
    64 typedef void *  (_System *  PTypedef2PVoid)(void);
    65 typedef int     (_System *  PTypedef2Int)(void);
    66 typedef PTYPE   (_System *  PTypedef2PType)(void);
     63typedef void    (_System *  PTypedef2Void)(int a, int b, int c, int d);
     64typedef void *  (_System *  PTypedef2PVoid)(int a, int b, int c, int d);
     65typedef int     (_System *  PTypedef2Int)(int a, int b, int c, int d);
     66typedef PTYPE   (_System *  PTypedef2PType)(int a, int b, int c, int d);
    6767
    6868
     
    7373typedef struct VFT
    7474{
    75     void    (* _System  PStructMemberVoid)(void* pvThis);
    76     void *  (* _System  PStructMemberPVoid)(void* pvThis);
    77     int     (* _System  PStructMemberInt)(void* pvThis);
    78     PTYPE   (* _System  PStructMemberPType)(void* pvThis);
     75    void    (* _System  PStructMemberVoid)(int a, int b, int c, int d);
     76    void *  (* _System  PStructMemberPVoid)(int a, int b, int c, int d);
     77    int     (* _System  PStructMemberInt)(int a, int b, int c, int d);
     78    PTYPE   (* _System  PStructMemberPType)(int a, int b, int c, int d);
    7979
    8080    /* Alternate writing which should have the same effect I think... */
    81     void    ( _System * PStructMember2Void)(void* pvThis);
    82     void *  ( _System * PStructMember2PVoid)(void* pvThis);
    83     int     ( _System * PStructMember2Int)(void* pvThis);
    84     PTYPE   ( _System * PStructMember2PType)(void* pvThis);
     81    void    ( _System * PStructMember2Void)(int a, int b, int c, int d);
     82    void *  ( _System * PStructMember2PVoid)(int a, int b, int c, int d);
     83    int     ( _System * PStructMember2Int)(int a, int b, int c, int d);
     84    PTYPE   ( _System * PStructMember2PType)(int a, int b, int c, int d);
    8585
    8686} VFT, *PVFT;
     
    9090int main(void)
    9191{
    92     ExternCVoid();
    93     ExternCPVoid();
    94     ExternCInt();
    95     ExternCPType();
     92    VFT vft = {Void, PVoid, Int, PType,
     93               Void, PVoid, Int, PType};
    9694
    97     Void();
    98     PVoid();
    99     Int();
    100     PType();
     95    Typedef1Void       * pfnTypedef1Void   = Void;
     96    Typedef1PVoid      * pfnTypedef1PVoid  = PVoid;
     97    Typedef1Int        * pfnTypedef1Int    = Int;
     98    Typedef1PType      * pfnTypedef1PType  = PType;
    10199
    102     foo::StaticMemberVoid();
    103     foo::StaticMemberPVoid();
    104     foo::StaticMemberInt();
    105     foo::StaticMemberPType();
     100    Typedef2Void       * pfnTypedef2Void   = Void;
     101    Typedef2PVoid      * pfnTypedef2PVoid  = PVoid;
     102    Typedef2Int        * pfnTypedef2Int    = Int;
     103    Typedef2PType      * pfnTypedef2PType  = PType;
     104
     105    PTypedef1Void        pfnPTypedef1Void  = Void;
     106    PTypedef1PVoid       pfnPTypedef1PVoid = PVoid;
     107    PTypedef1Int         pfnPTypedef1Int   = Int;
     108    PTypedef1PType       pfnPTypedef1PType = PType;
     109
     110    PTypedef2Void        pfnPTypedef2Void  = Void;
     111    PTypedef2PVoid       pfnPTypedef2PVoid = PVoid;
     112    PTypedef2Int         pfnPTypedef2Int   = Int;
     113    PTypedef2PType       pfnPTypedef2PType = PType;
     114
     115    /* extern functions */
     116    ExternCVoid(1,2,3,4);
     117    ExternCPVoid(1,2,3,4);
     118    ExternCInt(1,2,3,4);
     119    ExternCPType(1,2,3,4);
     120
     121    Void(1,2,3,4);
     122    PVoid(1,2,3,4);
     123    Int(1,2,3,4);
     124    PType(1,2,3,4);
     125
     126    /* class */
     127    foo::StaticMemberVoid(1,2,3,4);
     128    foo::StaticMemberPVoid(1,2,3,4);
     129    foo::StaticMemberInt(1,2,3,4);
     130    foo::StaticMemberPType(1,2,3,4);
    106131
    107132    foo obj;
    108     obj.MemberVoid();
    109     obj.MemberPVoid();
    110     obj.MemberInt();
    111     obj.MemberPType();
     133    obj.MemberVoid(1,2,3,4);
     134    obj.MemberPVoid(1,2,3,4);
     135    obj.MemberInt(1,2,3,4);
     136    obj.MemberPType(1,2,3,4);
    112137
    113     VFT vft = {0,0,0,0};
    114     if (vft.PStructMemberVoid)
    115         vft.PStructMemberVoid(&vft);
    116     if (vft.PStructMemberPVoid)
    117         vft.PStructMemberPVoid(&vft);
    118     if (vft.PStructMemberInt)
    119         vft.PStructMemberInt(&vft);
    120     if (vft.PStructMemberPType)
    121         vft.PStructMemberPType(&vft);
     138    /* typedefs */
     139    pfnTypedef1Void(1,2,3,4);
     140    pfnTypedef1PVoid(1,2,3,4);
     141    pfnTypedef1Int(1,2,3,4);
     142    pfnTypedef1PType(1,2,3,4);
     143
     144    pfnTypedef2Void(1,2,3,4);
     145    pfnTypedef2PVoid(1,2,3,4);
     146    pfnTypedef2Int(1,2,3,4);
     147    pfnTypedef2PType(1,2,3,4);
     148
     149    pfnPTypedef1Void(1,2,3,4);
     150    pfnPTypedef1PVoid(1,2,3,4);
     151    pfnPTypedef1Int(1,2,3,4);
     152    pfnPTypedef1PType(1,2,3,4);
     153
     154    pfnPTypedef2Void(1,2,3,4);
     155    pfnPTypedef2PVoid(1,2,3,4);
     156    pfnPTypedef2Int(1,2,3,4);
     157    pfnPTypedef2PType(1,2,3,4);
     158
     159
     160    /* structs */
     161    vft.PStructMemberVoid(1,2,3,4);
     162    vft.PStructMemberPVoid(1,2,3,4);
     163    vft.PStructMemberInt(1,2,3,4);
     164    vft.PStructMemberPType(1,2,3,4);
     165
     166    vft.PStructMember2Void(1,2,3,4);
     167    vft.PStructMember2PVoid(1,2,3,4);
     168    vft.PStructMember2Int(1,2,3,4);
     169    vft.PStructMember2PType(1,2,3,4);
    122170
    123171    /* test C stuff */
Note: See TracChangeset for help on using the changeset viewer.