]>
Commit | Line | Data |
---|---|---|
b4c522fa | 1 | // PERMUTE_ARGS: |
5fee5ec3 IB |
2 | |
3 | // COMDAT folding increases runtime by > 80x | |
4 | // REQUIRED_ARGS(windows): -L/OPT:NOICF | |
5 | ||
6 | // Apparently omf or optlink does not support more than 32767 symbols. | |
7 | // DISABLED: win32 | |
8 | ||
b4c522fa IB |
9 | // Generate \sum_{i=0}^{14} 2^i = 32767 template instantiations |
10 | // (each with 3 sections) to use more than 64Ki sections in total. | |
5fee5ec3 IB |
11 | |
12 | size_t foo(size_t i, size_t mask)() | |
b4c522fa | 13 | { |
5fee5ec3 IB |
14 | static if (i == 14) |
15 | return mask; | |
16 | else | |
17 | return foo!(i + 1, mask) + foo!(i + 1, mask | (1UL << i)); | |
b4c522fa | 18 | } |
b4c522fa | 19 | |
5fee5ec3 IB |
20 | void main() |
21 | { | |
22 | assert(foo!(0, 0) != 0); | |
b4c522fa | 23 | } |