Changeset caa649b for src/tests


Ignore:
Timestamp:
Mar 6, 2018, 12:11:11 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
520145b, e5d4e5c, e6c5e79
Parents:
094476d (diff), 1feb535f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/tests
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • src/tests/.expect/KRfunctions.x86.txt

    r094476d rcaa649b  
    8282    signed int __a__i_2;
    8383    signed int __b__i_2;
    84     signed int *(*_tmp_cp_ret0)(signed int __x__i_1, signed int __y__i_1);
    85     ((void)(__x__PFPi_ii__2=(((void)(_tmp_cp_ret0=__f10__FPFPi_ii__iPiPid__1(3, (&__a__i_2), (&__b__i_2), 3.5))) , _tmp_cp_ret0)));
    86     ((void)(_tmp_cp_ret0) /* ^?{} */);
     84    signed int *(*_tmp_cp_ret2)(signed int __x__i_1, signed int __y__i_1);
     85    ((void)(__x__PFPi_ii__2=(((void)(_tmp_cp_ret2=__f10__FPFPi_ii__iPiPid__1(3, (&__a__i_2), (&__b__i_2), 3.5))) , _tmp_cp_ret2)));
     86    ((void)(_tmp_cp_ret2) /* ^?{} */);
    8787    const signed int __f1__FCi_iPiPi__2(signed int __a__i_2, signed int *__b__Pi_2, signed int *__c__Pi_2){
    8888        __attribute__ ((unused)) const signed int ___retval_f1__Ci_2;
  • src/tests/.expect/literals.x64.txt

    r094476d rcaa649b  
    522522signed int __main__Fi___1(){
    523523    __attribute__ ((unused)) signed int ___retval_main__i_1;
     524    ((void)0b01101011);
     525    ((void)0b01101011u);
     526    ((void)0b01101011l);
     527    ((void)0b01101011ll);
     528    ((void)0b01101011ul);
     529    ((void)0b01101011lu);
     530    ((void)0b01101011ull);
     531    ((void)0b01101011llu);
     532    ((void)(+0b01101011));
     533    ((void)(+0b01101011u));
     534    ((void)(+0b01101011l));
     535    ((void)(+0b01101011ll));
     536    ((void)(+0b01101011ul));
     537    ((void)(+0b01101011lu));
     538    ((void)(+0b01101011ull));
     539    ((void)(+0b01101011llu));
     540    ((void)(-0b01101011));
     541    ((void)(-0b01101011u));
     542    ((void)(-0b01101011l));
     543    ((void)(-0b01101011ll));
     544    ((void)(-0b01101011ul));
     545    ((void)(-0b01101011lu));
     546    ((void)(-0b01101011ull));
     547    ((void)(-0b01101011llu));
    524548    ((void)01234567);
    525549    ((void)01234567u);
     
    10171041    ((void)(-0X0123456789.0123456789P-09F));
    10181042    ((void)(-0X0123456789.0123456789P-09L));
     1043    ((void)((signed char )0b01101011));
     1044    ((void)((signed short int )0b01101011));
     1045    ((void)((signed int )0b01101011));
     1046    ((void)((signed long int )0b01101011));
     1047    ((void)((__int128 )0b01101011));
     1048    ((void)((unsigned char )0b01101011u));
     1049    ((void)((signed short int )0b01101011u));
     1050    ((void)((unsigned int )0b01101011u));
     1051    ((void)((signed long int )0b01101011u));
     1052    ((void)((__int128 )0b01101011u));
     1053    ((void)(+((signed int )((signed char )0b01101011))));
     1054    ((void)(+((signed int )((signed short int )0b01101011))));
     1055    ((void)(+((signed int )0b01101011)));
     1056    ((void)(+((signed long int )0b01101011)));
     1057    ((void)(+((float )((__int128 )0b01101011))));
     1058    ((void)(+((signed int )((unsigned char )0b01101011u))));
     1059    ((void)(+((signed int )((signed short int )0b01101011u))));
     1060    ((void)(+((unsigned int )0b01101011u)));
     1061    ((void)(+((signed long int )0b01101011u)));
     1062    ((void)(+((float )((__int128 )0b01101011u))));
     1063    ((void)(-((signed int )((signed char )0b01101011))));
     1064    ((void)(-((signed int )((signed short int )0b01101011))));
     1065    ((void)(-((signed int )0b01101011)));
     1066    ((void)(-((signed long int )0b01101011)));
     1067    ((void)(-((float )((__int128 )0b01101011))));
     1068    ((void)(-((signed int )((unsigned char )0b01101011u))));
     1069    ((void)(-((signed int )((signed short int )0b01101011u))));
     1070    ((void)(-((unsigned int )0b01101011u)));
     1071    ((void)(-((signed long int )0b01101011u)));
     1072    ((void)(-((float )((__int128 )0b01101011u))));
    10191073    ((void)((signed char )01234567));
    10201074    ((void)((signed short int )01234567));
  • src/tests/.expect/user_literals.txt

    r094476d rcaa649b  
    1111.0714285714286
    2 11.07225
     215
    3311.0714285714286
     424.8
     511.248
    4611.0714285714286
    5 11.0714285714286
    6 22.0457142857143
     728.0657142857143
    78secs 1
    89secs 23
  • src/tests/Makefile.am

    r094476d rcaa649b  
    123123        ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
    124124
     125# Warnings
     126warnings/self-assignment: warnings/self-assignment.c @CFA_BINDIR@/@CFA_NAME@
     127        ${CC} ${AM_CFLAGS} ${CFLAGS} ${<} 2> ${@} -fsyntax-only
  • src/tests/Makefile.in

    r094476d rcaa649b  
    800800        ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
    801801
     802# Warnings
     803warnings/self-assignment: warnings/self-assignment.c @CFA_BINDIR@/@CFA_NAME@
     804        ${CC} ${AM_CFLAGS} ${CFLAGS} ${<} 2> ${@} -fsyntax-only
     805
    802806# Tell versions [3.59,3.63) of GNU make to not export all variables.
    803807# Otherwise a system limit (for SysV at least) may be exceeded.
  • src/tests/limits.c

    r094476d rcaa649b  
    1010// Created On       : Tue May 10 20:44:20 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 10 20:45:28 2016
    13 // Update Count     : 1
     12// Last Modified On : Thu Mar  1 16:21:55 2018
     13// Update Count     : 7
    1414//
    1515
     
    1818// Integral Constants
    1919
     20signed char m = MIN;
     21unsigned char m = MIN;
    2022short int m = MIN;
     23unsigned short int m = MIN;
    2124int m = MIN;
     25unsigned int m = MIN;
    2226long int m = MIN;
     27unsigned long int m = MIN;
    2328long long int m = MIN;
     29unsigned long long int m = MIN;
    2430
     31signed char M = MAX;
     32unsigned char M = MAX;
    2533short int M = MAX;
    2634unsigned short int M = MAX;
     
    3341
    3442// Floating-Point Constants
     43
     44float m = MIN;
     45double m = MIN;
     46long double m = MIN;
     47float _Complex m = MIN;
     48double _Complex m = MIN;
     49long double _Complex m = MIN;
     50
     51float M = MAX;
     52double M = MAX;
     53long double M = MAX;
     54float _Complex M = MAX;
     55double _Complex M = MAX;
     56long double _Complex M = MAX;
    3557
    3658float pi = PI;
     
    5577long double _2_sqrt_pi = _2_SQRT_PI;
    5678
    57 _Complex pi = PI;
    58 _Complex pi_2 = PI_2;
    59 _Complex pi_4 = PI_4;
    60 _Complex _1_pi = _1_PI;
    61 _Complex _2_pi = _2_PI;
    62 _Complex _2_sqrt_pi = _2_SQRT_PI;
     79float _Complex pi = PI;
     80float _Complex pi_2 = PI_2;
     81float _Complex pi_4 = PI_4;
     82float _Complex _1_pi = _1_PI;
     83float _Complex _2_pi = _2_PI;
     84float _Complex _2_sqrt_pi = _2_SQRT_PI;
    6385
    64 long _Complex pi = PI;
    65 long _Complex pi_2 = PI_2;
    66 long _Complex pi_4 = PI_4;
    67 long _Complex _1_pi = _1_PI;
    68 long _Complex _2_pi = _2_PI;
    69 long _Complex _2_sqrt_pi = _2_SQRT_PI;
     86double _Complex pi = PI;
     87double _Complex pi_2 = PI_2;
     88double _Complex pi_4 = PI_4;
     89double _Complex _1_pi = _1_PI;
     90double _Complex _2_pi = _2_PI;
     91double _Complex _2_sqrt_pi = _2_SQRT_PI;
     92
     93long double _Complex pi = PI;
     94long double _Complex pi_2 = PI_2;
     95long double _Complex pi_4 = PI_4;
     96long double _Complex _1_pi = _1_PI;
     97long double _Complex _2_pi = _2_PI;
     98long double _Complex _2_sqrt_pi = _2_SQRT_PI;
    7099
    71100float e = E;
     
    93122long double _1_sqrt_2 = _1_SQRT_2;
    94123
    95 _Complex e = E;
    96 _Complex log2_e = LOG2_E;
    97 _Complex log10_e = LOG10_E;
    98 _Complex ln_2 = LN_2;
    99 _Complex ln_10 = LN_10;
    100 _Complex sqrt_2 = SQRT_2;
    101 _Complex _1_sqrt_2 = _1_SQRT_2;
     124float _Complex e = E;
     125float _Complex log2_e = LOG2_E;
     126float _Complex log10_e = LOG10_E;
     127float _Complex ln_2 = LN_2;
     128float _Complex ln_10 = LN_10;
     129float _Complex sqrt_2 = SQRT_2;
     130float _Complex _1_sqrt_2 = _1_SQRT_2;
    102131
    103 long _Complex e = E;
    104 long _Complex log2_e = LOG2_E;
    105 long _Complex log10_e = LOG10_E;
    106 long _Complex ln_2 = LN_2;
    107 long _Complex ln_10 = LN_10;
    108 long _Complex sqrt_2 = SQRT_2;
    109 long _Complex _1_sqrt_2 = _1_SQRT_2;
     132double _Complex e = E;
     133double _Complex log2_e = LOG2_E;
     134double _Complex log10_e = LOG10_E;
     135double _Complex ln_2 = LN_2;
     136double _Complex ln_10 = LN_10;
     137double _Complex sqrt_2 = SQRT_2;
     138double _Complex _1_sqrt_2 = _1_SQRT_2;
     139
     140long double _Complex e = E;
     141long double _Complex log2_e = LOG2_E;
     142long double _Complex log10_e = LOG10_E;
     143long double _Complex ln_2 = LN_2;
     144long double _Complex ln_10 = LN_10;
     145long double _Complex sqrt_2 = SQRT_2;
     146long double _Complex _1_sqrt_2 = _1_SQRT_2;
    110147
    111148int main(int argc, char const *argv[]) {
  • src/tests/literals.c

    r094476d rcaa649b  
    1010// Created On       : Sat Sep  9 16:34:38 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 25 20:26:00 2017
    13 // Update Count     : 132
     12// Last Modified On : Sun Mar  4 10:41:31 2018
     13// Update Count     : 134
    1414//
    1515
     
    3131// integer literals
    3232
     33        // binary
     34         0b01101011;   0b01101011u;   0b01101011l;   0b01101011ll;   0b01101011ul;   0b01101011lu;   0b01101011ull;   0b01101011llu;
     35        +0b01101011;  +0b01101011u;  +0b01101011l;  +0b01101011ll;  +0b01101011ul;  +0b01101011lu;  +0b01101011ull;  +0b01101011llu;
     36        -0b01101011;  -0b01101011u;  -0b01101011l;  -0b01101011ll;  -0b01101011ul;  -0b01101011lu;  -0b01101011ull;  -0b01101011llu;
     37
    3338        // octal
    3439         01234567;   01234567u;   01234567l;   01234567ll;   01234567ul;   01234567lu;   01234567ull;   01234567llu;
     
    148153#ifdef __CFA__
    149154// fixed-size length
     155
     156        // binary
     157         0b01101011_l8;   0b01101011_l16;   0b01101011_l32;   0b01101011_l64;   0b01101011_l128;   0b01101011_l8u;   0b01101011_ul16;   0b01101011_l32u;   0b01101011_ul64;   0b01101011_ul128;
     158        +0b01101011_l8;  +0b01101011_l16;  +0b01101011_l32;  +0b01101011_l64;  +0b01101011_l128;  +0b01101011_l8u;  +0b01101011_ul16;  +0b01101011_l32u;  +0b01101011_ul64;  +0b01101011_ul128;
     159        -0b01101011_l8;  -0b01101011_l16;  -0b01101011_l32;  -0b01101011_l64;  -0b01101011_l128;  -0b01101011_l8u;  -0b01101011_ul16;  -0b01101011_l32u;  -0b01101011_ul64;  -0b01101011_ul128;
    150160
    151161        // octal
  • src/tests/user_literals.c

    r094476d rcaa649b  
    1010// Created On       : Wed Sep  6 21:40:50 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec  7 09:12:36 2017
    13 // Update Count     : 50
     12// Last Modified On : Sun Mar  4 11:14:02 2018
     13// Update Count     : 52
    1414//
    1515
     
    3131
    3232
    33 struct Weight {
    34         double stones;
    35 };
    36 void ?{}( Weight & w ) { w.stones = 0; }                                // operations
     33struct Weight { double stones; };
     34void ?{}( Weight & w ) { w.stones = 0; }
    3735void ?{}( Weight & w, double w ) { w.stones = w; }
    38 Weight ?+?( Weight l, Weight r ) { return (Weight){ l.stones + r.stones }; }
     36Weight ?+?( Weight l, Weight r ) {
     37        return (Weight){ l.stones + r.stones };
     38}
    3939ofstream & ?|?( ofstream & os, Weight w ) { return os | w.stones; }
    4040
    4141Weight ?`st( double w ) { return (Weight){ w }; }               // backquote for user literals
    4242Weight ?`lb( double w ) { return (Weight){ w / 14.0 }; }
    43 Weight ?`kg( double w ) { return (Weight) { w * 0.1575}; }
    44 
     43Weight ?`kg( double w ) { return (Weight) { w * 0.16 }; }
    4544
    4645int main() {
    47         Weight w, hw = { 14 };                                                          // 14 stone
    48         w = 11`st + 1`lb;
     46        Weight w, heavy = { 20 };                                                       // 20 stone
     47        w = 155`lb;
     48        sout | w | endl;
     49        w = 0b_1111`st;
     50        sout | w | endl;
     51        w = 0_233`lb;                                                                           // octal weight (155)
     52        sout | w | endl;
     53        w = 0x_9b_u`kg;
    4954        sout | w | endl;
    5055        w = 70.3`kg;
    5156        sout | w | endl;
    52         w = 155`lb;
     57        w = 11`st + 1`lb;
    5358        sout | w | endl;
    54         w = 0x_9b_u`lb;                                                                         // hexadecimal unsigned weight (155)
    55         sout | w | endl;
    56         w = 0_233`lb;                                                                           // octal weight (155)
    57         sout | w | endl;
    58         w = 5`st + 8`kg + 25`lb + hw;
     59        w = 5`st + 8`kg + 25`lb + heavy;
    5960        sout | w | endl;
    6061
Note: See TracChangeset for help on using the changeset viewer.