2012-01-04 05:04:31 +08:00
|
|
|
// RUN: %clang -fmodules -fno-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s
|
|
|
|
// CHECK-NO-MODULES-NOT: -fmodules
|
|
|
|
|
|
|
|
// RUN: %clang -fmodules -fno-modules -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s
|
|
|
|
// CHECK-HAS-MODULES: -fmodules
|
|
|
|
|
2014-08-02 06:12:21 +08:00
|
|
|
// RUN: %clang -fbuild-session-file=doesntexist -### %s 2>&1 | FileCheck -check-prefix=NOFILE %s
|
|
|
|
// NOFILE: no such file or directory: 'doesntexist'
|
|
|
|
|
2014-08-02 06:58:19 +08:00
|
|
|
// RUN: touch -m -a -t 201008011501 %t.build-session-file
|
2014-08-02 06:12:21 +08:00
|
|
|
// RUN: %clang -fbuild-session-file=%t.build-session-file -### %s 2>&1 | FileCheck -check-prefix=TIMESTAMP_ONLY %s
|
|
|
|
|
2014-08-02 06:58:19 +08:00
|
|
|
// RUN: %clang -fbuild-session-timestamp=1280703457 -### %s 2>&1 | FileCheck -check-prefix=TIMESTAMP_ONLY %s
|
2021-10-06 10:37:32 +08:00
|
|
|
// TIMESTAMP_ONLY: -fbuild-session-timestamp=128{{([[:digit:]]{7})[^[:digit:]]}}
|
2014-08-02 06:12:21 +08:00
|
|
|
|
|
|
|
// RUN: %clang -fbuild-session-file=%t.build-session-file -fbuild-session-timestamp=123 -### %s 2>&1 | FileCheck -check-prefix=CONFLICT %s
|
|
|
|
// CONFLICT: error: invalid argument '-fbuild-session-file={{.*}}.build-session-file' not allowed with '-fbuild-session-timestamp'
|
Add an option to allow Clang verify source files for a module only once during
the build
When Clang loads the module, it verifies the user source files that the module
was built from. If any file was changed, the module is rebuilt. There are two
problems with this:
1. correctness: we don't verify system files (there are too many of them, and
stat'ing all of them would take a lot of time);
2. performance: the same module file is verified again and again during a
single build.
This change allows the build system to optimize source file verification. The
idea is based on the fact that while the project is being built, the source
files don't change. This allows us to verify the module only once during a
single build session. The build system passes a flag,
-fbuild-session-timestamp=, to inform Clang of the time when the build started.
The build system also requests to enable this feature by passing
-fmodules-validate-once-per-build-session. If these flags are not passed, the
behavior is not changed. When Clang verifies the module the first time, it
writes out a timestamp file. Then, when Clang loads the module the second
time, it finds a timestamp file, so it can compare the verification timestamp
of the module with the time when the build started. If the verification
timestamp is too old, the module is verified again, and the timestamp file is
updated.
llvm-svn: 201224
2014-02-12 18:33:14 +08:00
|
|
|
|
|
|
|
// RUN: %clang -fbuild-session-timestamp=123 -fmodules-validate-once-per-build-session -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_ONCE %s
|
|
|
|
// MODULES_VALIDATE_ONCE: -fbuild-session-timestamp=123
|
|
|
|
// MODULES_VALIDATE_ONCE: -fmodules-validate-once-per-build-session
|
|
|
|
|
2014-08-02 06:12:21 +08:00
|
|
|
// RUN: %clang -fbuild-session-file=%t.build-session-file -fmodules-validate-once-per-build-session -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_ONCE_FILE %s
|
2021-10-06 10:37:32 +08:00
|
|
|
// MODULES_VALIDATE_ONCE_FILE: -fbuild-session-timestamp=128{{([[:digit:]]{7})[^[:digit:]]}}
|
2014-08-02 06:12:21 +08:00
|
|
|
// MODULES_VALIDATE_ONCE_FILE: -fmodules-validate-once-per-build-session
|
|
|
|
|
Add an option to allow Clang verify source files for a module only once during
the build
When Clang loads the module, it verifies the user source files that the module
was built from. If any file was changed, the module is rebuilt. There are two
problems with this:
1. correctness: we don't verify system files (there are too many of them, and
stat'ing all of them would take a lot of time);
2. performance: the same module file is verified again and again during a
single build.
This change allows the build system to optimize source file verification. The
idea is based on the fact that while the project is being built, the source
files don't change. This allows us to verify the module only once during a
single build session. The build system passes a flag,
-fbuild-session-timestamp=, to inform Clang of the time when the build started.
The build system also requests to enable this feature by passing
-fmodules-validate-once-per-build-session. If these flags are not passed, the
behavior is not changed. When Clang verifies the module the first time, it
writes out a timestamp file. Then, when Clang loads the module the second
time, it finds a timestamp file, so it can compare the verification timestamp
of the module with the time when the build started. If the verification
timestamp is too old, the module is verified again, and the timestamp file is
updated.
llvm-svn: 201224
2014-02-12 18:33:14 +08:00
|
|
|
// RUN: %clang -fmodules-validate-once-per-build-session -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_ONCE_ERR %s
|
2014-08-02 06:12:21 +08:00
|
|
|
// MODULES_VALIDATE_ONCE_ERR: option '-fmodules-validate-once-per-build-session' requires '-fbuild-session-timestamp=<seconds since Epoch>' or '-fbuild-session-file=<file>'
|
Add an option to allow Clang verify source files for a module only once during
the build
When Clang loads the module, it verifies the user source files that the module
was built from. If any file was changed, the module is rebuilt. There are two
problems with this:
1. correctness: we don't verify system files (there are too many of them, and
stat'ing all of them would take a lot of time);
2. performance: the same module file is verified again and again during a
single build.
This change allows the build system to optimize source file verification. The
idea is based on the fact that while the project is being built, the source
files don't change. This allows us to verify the module only once during a
single build session. The build system passes a flag,
-fbuild-session-timestamp=, to inform Clang of the time when the build started.
The build system also requests to enable this feature by passing
-fmodules-validate-once-per-build-session. If these flags are not passed, the
behavior is not changed. When Clang verifies the module the first time, it
writes out a timestamp file. Then, when Clang loads the module the second
time, it finds a timestamp file, so it can compare the verification timestamp
of the module with the time when the build started. If the verification
timestamp is too old, the module is verified again, and the timestamp file is
updated.
llvm-svn: 201224
2014-02-12 18:33:14 +08:00
|
|
|
|
2014-03-12 08:06:17 +08:00
|
|
|
// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_SYSTEM_HEADERS_DEFAULT %s
|
|
|
|
// MODULES_VALIDATE_SYSTEM_HEADERS_DEFAULT-NOT: -fmodules-validate-system-headers
|
|
|
|
|
2018-04-18 14:07:49 +08:00
|
|
|
// RUN: %clang -fmodules -fsyntax-only -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_SYSTEM_HEADERS_DEFAULT_MOD %s
|
|
|
|
// MODULES_VALIDATE_SYSTEM_HEADERS_DEFAULT_MOD: -fmodules-validate-system-headers
|
|
|
|
|
2014-03-12 08:06:17 +08:00
|
|
|
// RUN: %clang -fmodules-validate-system-headers -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_SYSTEM_HEADERS %s
|
|
|
|
// MODULES_VALIDATE_SYSTEM_HEADERS: -fmodules-validate-system-headers
|
2014-10-17 09:42:53 +08:00
|
|
|
|
2018-04-18 14:07:49 +08:00
|
|
|
// RUN: %clang -fno-modules-validate-system-headers -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_SYSTEM_HEADERS_NOSYSVALID %s
|
|
|
|
// MODULES_VALIDATE_SYSTEM_HEADERS_NOSYSVALID-NOT: -fmodules-validate-system-headers
|
|
|
|
|
2016-07-27 01:12:17 +08:00
|
|
|
// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=MODULES_DISABLE_DIAGNOSTIC_VALIDATION_DEFAULT %s
|
|
|
|
// MODULES_DISABLE_DIAGNOSTIC_VALIDATION_DEFAULT-NOT: -fmodules-disable-diagnostic-validation
|
|
|
|
|
|
|
|
// RUN: %clang -fmodules-disable-diagnostic-validation -### %s 2>&1 | FileCheck -check-prefix=MODULES_DISABLE_DIAGNOSTIC_VALIDATION %s
|
|
|
|
// MODULES_DISABLE_DIAGNOSTIC_VALIDATION: -fmodules-disable-diagnostic-validation
|
|
|
|
|
2016-08-19 01:42:15 +08:00
|
|
|
// RUN: %clang -fmodules -### %s 2>&1 | FileCheck -check-prefix=MODULES_PREBUILT_PATH_DEFAULT %s
|
|
|
|
// MODULES_PREBUILT_PATH_DEFAULT-NOT: -fprebuilt-module-path
|
|
|
|
|
|
|
|
// RUN: %clang -fmodules -fprebuilt-module-path=foo -fprebuilt-module-path=bar -### %s 2>&1 | FileCheck -check-prefix=MODULES_PREBUILT_PATH %s
|
|
|
|
// MODULES_PREBUILT_PATH: "-fprebuilt-module-path=foo"
|
|
|
|
// MODULES_PREBUILT_PATH: "-fprebuilt-module-path=bar"
|
|
|
|
|
2014-10-17 09:42:53 +08:00
|
|
|
// RUN: %clang -fmodules -fmodule-map-file=foo.map -fmodule-map-file=bar.map -### %s 2>&1 | FileCheck -check-prefix=CHECK-MODULE-MAP-FILES %s
|
|
|
|
// CHECK-MODULE-MAP-FILES: "-fmodules"
|
2014-10-17 09:52:48 +08:00
|
|
|
// CHECK-MODULE-MAP-FILES: "-fmodule-map-file=foo.map"
|
|
|
|
// CHECK-MODULE-MAP-FILES: "-fmodule-map-file=bar.map"
|
2015-09-11 11:58:07 +08:00
|
|
|
|
2016-10-31 16:21:54 +08:00
|
|
|
// RUN: %clang -fmodules -fbuiltin-module-map -### %s 2>&1 | FileCheck -check-prefix=CHECK-BUILTIN-MODULE-MAP %s
|
|
|
|
// CHECK-BUILTIN-MODULE-MAP: "-fmodules"
|
|
|
|
// CHECK-BUILTIN-MODULE-MAP: "-fmodule-map-file={{.*}}include{{/|\\\\}}module.modulemap"
|
|
|
|
|
2015-09-11 11:58:07 +08:00
|
|
|
// RUN: %clang -fmodules -fmodule-file=foo.pcm -fmodule-file=bar.pcm -### %s 2>&1 | FileCheck -check-prefix=CHECK-MODULE-FILES %s
|
|
|
|
// CHECK-MODULE-FILES: "-fmodules"
|
|
|
|
// CHECK-MODULE-FILES: "-fmodule-file=foo.pcm"
|
|
|
|
// CHECK-MODULE-FILES: "-fmodule-file=bar.pcm"
|
|
|
|
|
|
|
|
// RUN: %clang -fno-modules -fmodule-file=foo.pcm -fmodule-file=bar.pcm -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULE-FILES %s
|
|
|
|
// CHECK-NO-MODULE-FILES-NOT: "-fmodules"
|
|
|
|
// CHECK-NO-MODULE-FILES-NOT: "-fmodule-file=foo.pcm"
|
|
|
|
// CHECK-NO-MODULE-FILES-NOT: "-fmodule-file=bar.pcm"
|