]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/runnable/test17338.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / runnable / test17338.d
1 // PERMUTE_ARGS:
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
9 // Generate \sum_{i=0}^{14} 2^i = 32767 template instantiations
10 // (each with 3 sections) to use more than 64Ki sections in total.
11
12 size_t foo(size_t i, size_t mask)()
13 {
14 static if (i == 14)
15 return mask;
16 else
17 return foo!(i + 1, mask) + foo!(i + 1, mask | (1UL << i));
18 }
19
20 void main()
21 {
22 assert(foo!(0, 0) != 0);
23 }