diff options
Diffstat (limited to 'test/Modules/explicit-build.cpp')
| -rw-r--r-- | test/Modules/explicit-build.cpp | 30 | 
1 files changed, 28 insertions, 2 deletions
| diff --git a/test/Modules/explicit-build.cpp b/test/Modules/explicit-build.cpp index ce3a1af41626..6fe9f7ee46a3 100644 --- a/test/Modules/explicit-build.cpp +++ b/test/Modules/explicit-build.cpp @@ -64,6 +64,19 @@  // RUN:            -fmodule-file=%t/c.pcm \  // RUN:            -verify %s -DHAVE_A -DHAVE_B -DHAVE_C +// ------------------------------- +// Check that -fmodule-file= in a module build makes the file transitively +// available even if it's not used. +// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fno-implicit-modules -Rmodule-build -fno-modules-error-recovery \ +// RUN:            -fmodule-file=%t/b.pcm \ +// RUN:            -fmodule-name=d -emit-module %S/Inputs/explicit-build/module.modulemap -o %t/d.pcm \ +// RUN:            2>&1 | FileCheck --check-prefix=CHECK-NO-IMPLICIT-BUILD %s --allow-empty +// +// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fno-implicit-modules -Rmodule-build -fno-modules-error-recovery \ +// RUN:            -I%S/Inputs/explicit-build \ +// RUN:            -fmodule-file=%t/d.pcm \ +// RUN:            -verify %s -DHAVE_A -DHAVE_B +  #if HAVE_A    #include "a.h"    static_assert(a == 1, ""); @@ -148,11 +161,24 @@  // RUN:            -fmodule-file=%t/not.pcm \  // RUN:            %s 2>&1 | FileCheck --check-prefix=CHECK-BAD-FILE %s  // +// CHECK-BAD-FILE: fatal error: file '{{.*}}not.pcm' is not a valid precompiled module file +  // RUN: not %clang_cc1 -x c++ -std=c++11 -fmodules -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \  // RUN:            -fmodule-file=%t/nonexistent.pcm \ -// RUN:            %s 2>&1 | FileCheck --check-prefix=CHECK-BAD-FILE %s +// RUN:            %s 2>&1 | FileCheck --check-prefix=CHECK-NO-FILE %s +// +// CHECK-NO-FILE: fatal error: module file '{{.*}}nonexistent.pcm' not found + +// RUN: mv %t/a.pcm %t/a-tmp.pcm +// RUN: not %clang_cc1 -x c++ -std=c++11 -fmodules -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ +// RUN:            -I%S/Inputs/explicit-build \ +// RUN:            -fmodule-file=%t/c.pcm \ +// RUN:            %s 2>&1 | FileCheck --check-prefix=CHECK-NO-FILE-INDIRECT %s +// RUN: mv %t/a-tmp.pcm %t/a.pcm  // -// CHECK-BAD-FILE: fatal error: file '{{.*}}t.pcm' is not a precompiled module file +// CHECK-NO-FILE-INDIRECT:      error: module file '{{.*}}a.pcm' not found +// CHECK-NO-FILE-INDIRECT-NEXT: note: imported by module 'b' in '{{.*}}b.pcm' +// CHECK-NO-FILE-INDIRECT-NEXT: note: imported by module 'c' in '{{.*}}c.pcm'  // -------------------------------  // Check that we don't get upset if B's timestamp is newer than C's. | 
