]> git.ipfire.org Git - thirdparty/gcc.git/blame - 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
CommitLineData
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
12size_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
20void main()
21{
22 assert(foo!(0, 0) != 0);
b4c522fa 23}