|
| 1 | +! TODO: For some reason, on Windows, nothing is printed to stderr which causes |
| 2 | +! the checks to fail. It is not clear why this is, so disable this on Windows |
| 3 | +! until the root cause can be determined. |
| 4 | +! |
| 5 | +! UNSUPPORTED: system-windows |
| 6 | + |
| 7 | +! The -time option prints timing information for the various subcommands in a |
| 8 | +! format similar to that used by gfortran. When compiling and linking, this will |
| 9 | +! include the time to call flang-${LLVM_VERSION_MAJOR} and the linker. Since the |
| 10 | +! name of the linker could vary across platforms, and the flang name could also |
| 11 | +! potentially be something different, just check that whatever is printed to |
| 12 | +! stderr looks like timing information. |
| 13 | + |
| 14 | +! Ideally, this should be tested on various platforms, but that requires the |
| 15 | +! the full toolchain, including a linker to be present. The initial author of |
| 16 | +! the test only had access to Linux on x86 which is why this is only enabled |
| 17 | +! there. More platforms ought to be added if possible. |
| 18 | + |
| 19 | +! REQUIRES: x86_64-linux |
| 20 | + |
| 21 | +! RUN: %flang --target=x86_64-linux -time -c -o /dev/null %s 2>&1 \ |
| 22 | +! RUN: | FileCheck %s --check-prefix=COMPILE-ONLY |
| 23 | +! RUN: %flang --target=x86_64-linux -time -S -emit-llvm -O3 -o /dev/null %s 2>&1 \ |
| 24 | +! RUN: | FileCheck %s --check-prefix=COMPILE-ONLY |
| 25 | +! RUN: %flang --target=x86_64-linux -time -S -o /dev/null %s 2>&1 \ |
| 26 | +! RUN: | FileCheck %s --check-prefix=COMPILE-ONLY |
| 27 | +! RUN: %flang --target=x86_64-linux -time -o /dev/null %s 2>&1 \ |
| 28 | +! RUN: | FileCheck %s --check-prefix=COMPILE-AND-LINK |
| 29 | + |
| 30 | +! COMPILE-ONLY: # {{.+}} {{[0-9]+(.[0-9]+)?}} {{[0-9]+(.[0-9]+)?}} |
| 31 | +! COMPILE-ONLY-NOT: {{.}} |
| 32 | + |
| 33 | +! COMPILE-AND-LINK: # {{.+}} {{[0-9]+(.[0-9]+)?}} {{[0-9]+(.[0-9]+)?}} |
| 34 | +! COMPILE-AND-LINK: # {{.+}} {{[0-9]+(.[0-9]+)?}} {{[0-9]+(.[0-9]+)?}} |
| 35 | + |
| 36 | +end program |
0 commit comments