|
| 1 | +// RUN: llvm-tblgen -print-records %s | FileCheck %s |
| 2 | +// RUN: not llvm-tblgen -DOOR1 -print-records %s 2>&1 | FileCheck %s --check-prefix=CHECK-OOR |
| 3 | +// RUN: not llvm-tblgen -DOOR2 -print-records %s 2>&1 | FileCheck %s --check-prefix=CHECK-OOR |
| 4 | +// RUN: not llvm-tblgen -DOOR3 -print-records %s 2>&1 | FileCheck %s --check-prefix=CHECK-OOR |
| 5 | + |
| 6 | +def { |
| 7 | + |
| 8 | +#ifdef OOR1 |
| 9 | + bits<64> Val = -9223372036854775809; |
| 10 | +#endif |
| 11 | + |
| 12 | +#ifdef OOR2 |
| 13 | + bits<64> Val = 0b10000000000000000000000000000000000000000000000000000000000000000; |
| 14 | +#endif |
| 15 | + |
| 16 | +#ifdef OOR3 |
| 17 | + bits<64> Val = 0x10000000000000000; |
| 18 | +#endif |
| 19 | +// CHECK-OOR: error: Number out of range |
| 20 | + |
| 21 | + bits<64> BinVal0 = 0x8000000000000000; |
| 22 | + bits<64> HexVal0 = 0b1000000000000000000000000000000000000000000000000000000000000000; |
| 23 | + bits<64> DecVal0_0 = 9223372036854775808; |
| 24 | + bits<64> DecVal0_1 = -9223372036854775808; |
| 25 | + |
| 26 | + bits<64> HexVal1 = 0x8000000000000001; |
| 27 | + bits<64> DecVal1 = 9223372036854775809; |
| 28 | + |
| 29 | +// CHECK: bits<64> BinVal0 = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
| 30 | +// CHECK: bits<64> HexVal0 = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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