1This directory contains tests for link-time optimization (LTO). 2Tests in this directory may span multiple files, so the naming of 3the files is significant. 4 5The name of every file must end with '_N' where N is an integer. 6All the files with the same name base and different _N suffixes 7will be compiled separately and linked together to form the final 8executable. 9 10By default, each set of files will be compiled with list of 11options listed in LTO_OPTIONS (../../lib/lto.exp), which can be 12overwritten in the shell environment or using the 'dg-lto-options' 13command in the main file of the set (i.e., the file with _0 14suffix). 15 16For example, given the files a_0.C a_1.C a_2.C, they will be 17compiled as: 18 19$ g++ -c <flags> a_0.C 20$ g++ -c <flags> a_1.C 21$ g++ -c <flags> a_2.C 22$ g++ -o <executable> a_0.o a_1.o a_2.o 23 24Tests that do not need more than one file are a special case 25where there is a single file named 'foo_0.C'. 26 27The only supported dg-lto-do option are 'assemble', 'run' and 'link'. 28Additionally, these can only be used in the main file. If 29'assemble' is used, only the individual object files are 30generated. If 'link' is used, the final executable is generated 31but not executed (in this case, function main() needs to exist 32but it does not need to do anything). If 'run' is used, the 33final executable is generated and the resulting binary executed. 34 35The default value for dg-lto-do is 'run'. 36