blob: 68d2cbd4279fcff81d7c1d686735e74cd9386ff4 [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//
NAKAMURA Takumi8ca1b5a2014-12-02 03:55:16 +00004// REQUIRES: shell
5//
Richard Smith34f30512013-11-23 04:06:09 +00006// RUN: rm -rf %t
Richard Smith3c1a41a2014-12-02 00:08:08 +00007// RUN: cd %S
8// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t -I Inputs/malformed -DHEADER="a1.h" %s 2>&1 | FileCheck %s --check-prefix=CHECK-A
9// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t -I Inputs/malformed -DHEADER="b1.h" %s 2>&1 | FileCheck %s --check-prefix=CHECK-B
Richard Smith34f30512013-11-23 04:06:09 +000010
11#define STR2(x) #x
12#define STR(x) STR2(x)
13#include STR(HEADER)
14
Richard Smith556f03e2013-11-23 05:21:32 +000015// CHECK-A: While building module 'malformed_a'
Richard Smith3c1a41a2014-12-02 00:08:08 +000016// CHECK-A: {{^}}Inputs/malformed/a1.h:1:{{.*}} error: expected '}'
17// CHECK-A: {{^}}Inputs/malformed/a1.h:1:{{.*}} note: to match this '{'
Richard Smith34f30512013-11-23 04:06:09 +000018//
Richard Smith556f03e2013-11-23 05:21:32 +000019// CHECK-A: While building module 'malformed_a'
Richard Smith3c1a41a2014-12-02 00:08:08 +000020// CHECK-A: {{^}}Inputs/malformed/a2.h:1:{{.*}} error: extraneous closing brace
Richard Smith34f30512013-11-23 04:06:09 +000021
Richard Smith556f03e2013-11-23 05:21:32 +000022// CHECK-B: While building module 'malformed_b'
Richard Smith3c1a41a2014-12-02 00:08:08 +000023// CHECK-B: {{^}}Inputs/malformed/b1.h:2:{{.*}} error: expected '}'
24// CHECK-B: {{^}}Inputs/malformed/b1.h:1:{{.*}} note: to match this '{'
25// CHECK-B: {{^}}Inputs/malformed/b1.h:3:{{.*}} error: extraneous closing brace ('}')
Richard Smith34f30512013-11-23 04:06:09 +000026//
Richard Smith556f03e2013-11-23 05:21:32 +000027// CHECK-B: While building module 'malformed_b'
Richard Smith3c1a41a2014-12-02 00:08:08 +000028// CHECK-B: {{^}}Inputs/malformed/b2.h:1:{{.*}} error: redefinition of 'g'
29// CHECK-B: {{^}}Inputs/malformed/b2.h:1:{{.*}} note: previous definition is here