Skip to content

Existing test files depends on 64bit CPU #1569

@demotomohiro

Description

@demotomohiro

In tests directory, there are *.nif and *.c files compared with files generated by nimsem or NIFC when haster runs tests.
Some of these files contains 64bit CPU specific code and when I run tests on 32bit CPU, they doesn't match generated code.

For example, when I compile following code:

var x = 0
var y = 0
discard x == y

nimsem with --bits:32 generates:

 (discard 10
  (eq
   (i +32) ~2 x.0.tesnnc3gc 3 y.0.tesnnc3gc))

but --bits:64 generates:

 (discard 10
  (eq
   (i +64) ~2 x.0.tesnnc3gc 3 y.0.tesnnc3gc)))

NIFC with --bits:32 generates:

#define NIM_INTBITS 32
...
NI x_0_tesnnc3gc = 123;
NI y_0_tesnnc3gc = 123;

--bits:64 generates:

#define NIM_INTBITS 64
...
NI x_0_tesnnc3gc = IL64(123);
NI y_0_tesnnc3gc = IL64(123);

So we probably needs two kinds of *.nif and *.c files for tests like *.32bit.nif and *.32bit.c files for 32bit CPU and *.64bit.c and *.64bit.nif for 64bit CPU.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions