diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-11 00:05:21 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-11 00:05:21 +0000 |
commit | a24ff5545bbd80ac78c6db1e1ebf826d3482da9d (patch) | |
tree | e97b860513c1a255d25764aa72d82e5051d05fa1 /clang/test/Modules/explicit-build-missing-files.cpp | |
parent | 629d8e6f18922a2c0a9df6b59ab8ac2bdeb16d2f (diff) | |
download | bcm5719-llvm-a24ff5545bbd80ac78c6db1e1ebf826d3482da9d.tar.gz bcm5719-llvm-a24ff5545bbd80ac78c6db1e1ebf826d3482da9d.zip |
[modules] Properly diagnose errors in module files for which we have no
corresponding include location (those specified on the command line).
llvm-svn: 244538
Diffstat (limited to 'clang/test/Modules/explicit-build-missing-files.cpp')
-rw-r--r-- | clang/test/Modules/explicit-build-missing-files.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/clang/test/Modules/explicit-build-missing-files.cpp b/clang/test/Modules/explicit-build-missing-files.cpp index 2ea157b934c..3c8d43460f4 100644 --- a/clang/test/Modules/explicit-build-missing-files.cpp +++ b/clang/test/Modules/explicit-build-missing-files.cpp @@ -1,7 +1,7 @@ // RUN: rm -rf %t // RUN: mkdir %t // RUN: echo 'extern int a;' > %t/a.h -// RUN: echo 'extern int b;' > %t/b.h +// RUN: echo 'extern int b; template<typename T> int b2 = T::error;' > %t/b.h // RUN: echo 'module a { header "a.h" header "b.h" }' > %t/modulemap // We lazily check that the files referenced by an explicitly-specified .pcm @@ -10,12 +10,23 @@ // // RUN: %clang_cc1 -fmodules -I %t -emit-module -fmodule-name=a -x c++ %t/modulemap -o %t/a.pcm // RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s +// RUN: not %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s -DERRORS 2>&1 | FileCheck %s // RUN: rm %t/modulemap // RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s +// RUN: not %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s -DERRORS 2>&1 | FileCheck %s // RUN: rm %t/b.h // RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s +// RUN: not %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s -DERRORS 2>&1 | FileCheck %s --check-prefix=MISSING-B // RUN: rm %t/a.h // RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s -verify #include "a.h" // expected-error {{file not found}} int x = b; + +#ifdef ERRORS +int y = b2<int>; +// CHECK: In module 'a': +// CHECK-NEXT: b.h:1:45: error: + +// MISSING-B: could not find file '{{.*}}b.h' +#endif |