Changeset 30d91e4 for tests/enum_tests


Ignore:
Timestamp:
Apr 14, 2022, 2:59:16 PM (3 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
365c8dcb
Parents:
d8c4fab
Message:

Change the code gen for enum value. Hope it fixes the gcc compatibility problem

Location:
tests/enum_tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/enum_tests/.expect/typedIntEnum.txt

    rd8c4fab r30d91e4  
    1 zero: 0, one: 1
     10
     21
     31000
     41001
     52000
     62001
     72002
  • tests/enum_tests/typedIntEnum.cfa

    rd8c4fab r30d91e4  
    33enum(int) IntEnum {
    44    zero,
    5     one
     5    one,
     6    thousand = 1000,
     7    thousand_one,
     8    two_thousand = 2000,
     9    two_thousand_one,
     10    two_thousand_two
    611};
    712
    813int main() {
    9     printf("zero: %d, one: %d\n", zero, one);
     14    printf("%d\n", zero);
     15    printf("%d\n", one);
     16    printf("%d\n", thousand);
     17    printf("%d\n", thousand_one);
     18    printf("%d\n", two_thousand);
     19    printf("%d\n", two_thousand_one);
     20    printf("%d\n", two_thousand_two);
    1021    return 0;
    1122}
Note: See TracChangeset for help on using the changeset viewer.