blob: 040361c9eeb8ed4e1645b282ec1b7307a715855b [file] [log] [blame]
Richard Smith3c1a41a2014-12-02 00:08:08 +00001// This test explicitly cd's to the test/Modules directory so that we can test
2// that filenames found via relative -I paths are printed correctly.
3//
Richard Smith34f30512013-11-23 04:06:09 +00004// RUN: rm -rf %t
Richard Smith3c1a41a2014-12-02 00:08:08 +00005// RUN: cd %S
Richard Smith47972af2015-06-16 00:08:24 +00006// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I Inputs/malformed -DHEADER="a1.h" %s 2>&1 | FileCheck %s --check-prefix=CHECK-A
7// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I Inputs/malformed -DHEADER="b1.h" %s 2>&1 | FileCheck %s --check-prefix=CHECK-B
8// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I Inputs/malformed -DHEADER="c.h" malformed.cpp 2>&1 | FileCheck %s --check-prefix=CHECK-C
Richard Smith34f30512013-11-23 04:06:09 +00009
10#define STR2(x) #x
11#define STR(x) STR2(x)
12#include STR(HEADER)
13
Richard Smith556f03e2013-11-23 05:21:32 +000014// CHECK-A: While building module 'malformed_a'
Serge Pavlovc4e04a22015-09-19 05:32:57 +000015// CHECK-A: {{^}}Inputs/malformed/a1.h:1:{{.*}} error: expected '}' at end of module
Richard Smith3c1a41a2014-12-02 00:08:08 +000016// CHECK-A: {{^}}Inputs/malformed/a1.h:1:{{.*}} note: to match this '{'
Richard Smith34f30512013-11-23 04:06:09 +000017//
Richard Smith556f03e2013-11-23 05:21:32 +000018// CHECK-A: While building module 'malformed_a'
Richard Smith3c1a41a2014-12-02 00:08:08 +000019// CHECK-A: {{^}}Inputs/malformed/a2.h:1:{{.*}} error: extraneous closing brace
Richard Smith34f30512013-11-23 04:06:09 +000020
Richard Smith556f03e2013-11-23 05:21:32 +000021// CHECK-B: While building module 'malformed_b'
Serge Pavlovc4e04a22015-09-19 05:32:57 +000022// CHECK-B: {{^}}Inputs/malformed/b1.h:2:{{.*}} error: import of module 'malformed_b.b2' appears within 'S'
Richard Smith223d3f22014-12-06 03:21:08 +000023
24void test() { f<int>(); }
25// Test that we use relative paths to name files within an imported module.
26//
Reid Kleckneracbd23a2015-03-02 22:42:58 +000027// CHECK-C: In module 'c' imported from malformed.cpp:12:
Richard Smith223d3f22014-12-06 03:21:08 +000028// CHECK-C: {{^}}Inputs/malformed/c.h:1:33: error: type 'int' cannot be used prior to '::'
29// CHECK-C: {{^}}malformed.cpp:[[@LINE-5]]:15: note: in instantiation of