Show
Ignore:
Timestamp:
08/18/08 08:40:54 (5 months ago)
Author:
Chuck.Esterbrook
Message:

Fixed: Some bitwise operations with integer literals of 16 or 8 bits produce invalid compilation errors.
reported-by:hopscc

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Tests/100-basics/920-hex-lit.cobra

    r1537 r1581  
    137137                        assert b.getType is Byte 
    138138                                 
    139                         # These dont compile for some reason - same with non hex vals 
    140                         #b = 255u8 
    141                         #b = b & 0x1fu8 
    142                         ## OR 
    143                         ##b = b & 31u8 
    144                         #assert b == 0x1fu8 
    145                         #b = 255u8 
    146                         #b1 = 0x1fu8 
    147                         #b = b & b1 
    148                         #print b 
     139                        b = 255u8 
     140                        b = b & 0x1fu8 
     141                        assert b == 0x1fu8 
     142 
     143                        b = 255u8 
     144                        b = b & 31u8 
     145                        assert b == 0x1fu8 
     146 
     147                        b = 255u8 
     148                        b1 = 0x1fu8 
     149                        b = b & b1 
     150                        assert b == 0x1fu8 
    149151         
    150152                        c = 0x0_u8 
     
    152154                        assert c == 0x1e_u8 
    153155                                 
    154                         # Neither do these 
    155                         #c = 0x0_u8 
    156                         #c = c | 0x0_u8 
    157                         #assert c == 0x1e_u8 
    158                         # 
    159                         #c = 0x0_u8 
    160                         #c1 = 0x0_u8 
    161                         #c = c | c1 
    162                         #assert c == 0x1e_u8 
    163                                  
     156                        c = 0x0_u8 
     157                        c = c | 0x1e_u8 
     158                        assert c == 0x1e_u8 
     159 
     160                        c = 0x0_u8 
     161                        c1 = 0x1e_u8 
     162                        c = c | c1 
     163                        assert c == 0x1e_u8 
     164         
    164165                def main is shared 
    165166                        .lit