diff options
author | Bung <crc32@qq.com> | 2022-12-23 19:20:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-23 12:20:25 +0100 |
commit | 0b319fee3de90759987beba289df3c48ab6d3f1a (patch) | |
tree | 648afcb1a0caf4dcb68cab67a1637afff15b9efe /tests | |
parent | ca9c74391a2169be0b0e5c7b6705eaf9560a44bd (diff) | |
download | Nim-0b319fee3de90759987beba289df3c48ab6d3f1a.tar.gz |
fix #20997 calling system.card[T](x: set[T]) with T of int8 or uint8 … (#21010)
* fix #20997 calling system.card[T](x: set[T]) with T of int8 or uint8 uses mismatched C array sizes * fullfil set variant
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sets/t20997.nim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/sets/t20997.nim b/tests/sets/t20997.nim new file mode 100644 index 000000000..b320eee1a --- /dev/null +++ b/tests/sets/t20997.nim @@ -0,0 +1,18 @@ +discard """ + joinable: false +""" + +{.passC: "-flto".} +{.passL: "-flto".} + +template f(n: int) = discard card(default(set[range[0 .. (1 shl n) - 1]])) +f( 7) +f( 8) +f( 9) +f(10) +f(11) +f(12) +f(13) +f(14) +f(15) +f(16) |