diff options
author | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
commit | c86b984ea8ecb3e944dc3de48539f4c1f65851ea (patch) | |
tree | 3eb853da77d46cc77c4b017525a422f9ddb1385b /test/Modules/malformed.cpp | |
parent | c696171ff15f0ee60dea4abfd99a135473c95656 (diff) | |
download | FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.zip FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.tar.gz |
Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc1@226102
Diffstat (limited to 'test/Modules/malformed.cpp')
-rw-r--r-- | test/Modules/malformed.cpp | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/test/Modules/malformed.cpp b/test/Modules/malformed.cpp index cd7b334..2554c3a 100644 --- a/test/Modules/malformed.cpp +++ b/test/Modules/malformed.cpp @@ -1,23 +1,37 @@ +// This test explicitly cd's to the test/Modules directory so that we can test +// that filenames found via relative -I paths are printed correctly. +// +// REQUIRES: shell +// // RUN: rm -rf %t -// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs/malformed -DHEADER="a1.h" %s 2>&1 | FileCheck %s --check-prefix=CHECK-A -// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs/malformed -DHEADER="b1.h" %s 2>&1 | FileCheck %s --check-prefix=CHECK-B +// RUN: cd %S +// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t -I Inputs/malformed -DHEADER="a1.h" %s 2>&1 | FileCheck %s --check-prefix=CHECK-A +// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t -I Inputs/malformed -DHEADER="b1.h" %s 2>&1 | FileCheck %s --check-prefix=CHECK-B +// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t -I Inputs/malformed -DHEADER="c.h" malformed.cpp 2>&1 | FileCheck %s --check-prefix=CHECK-C #define STR2(x) #x #define STR(x) STR2(x) #include STR(HEADER) // CHECK-A: While building module 'malformed_a' -// CHECK-A: a1.h:1:{{.*}} error: expected '}' -// CHECK-A: a1.h:1:{{.*}} note: to match this '{' +// CHECK-A: {{^}}Inputs/malformed/a1.h:1:{{.*}} error: expected '}' +// CHECK-A: {{^}}Inputs/malformed/a1.h:1:{{.*}} note: to match this '{' // // CHECK-A: While building module 'malformed_a' -// CHECK-A: a2.h:1:{{.*}} error: extraneous closing brace +// CHECK-A: {{^}}Inputs/malformed/a2.h:1:{{.*}} error: extraneous closing brace // CHECK-B: While building module 'malformed_b' -// CHECK-B: b1.h:2:{{.*}} error: expected '}' -// CHECK-B: b1.h:1:{{.*}} note: to match this '{' -// CHECK-B: b1.h:3:{{.*}} error: extraneous closing brace ('}') +// CHECK-B: {{^}}Inputs/malformed/b1.h:2:{{.*}} error: expected '}' +// CHECK-B: {{^}}Inputs/malformed/b1.h:1:{{.*}} note: to match this '{' +// CHECK-B: {{^}}Inputs/malformed/b1.h:3:{{.*}} error: extraneous closing brace ('}') // // CHECK-B: While building module 'malformed_b' -// CHECK-B: b2.h:1:{{.*}} error: redefinition of 'g' -// CHECK-B: b2.h:1:{{.*}} note: previous definition is here +// CHECK-B: {{^}}Inputs/malformed/b2.h:1:{{.*}} error: redefinition of 'g' +// CHECK-B: {{^}}Inputs/malformed/b2.h:1:{{.*}} note: previous definition is here + +void test() { f<int>(); } +// Test that we use relative paths to name files within an imported module. +// +// CHECK-C: In module 'c' imported from malformed.cpp:14: +// CHECK-C: {{^}}Inputs/malformed/c.h:1:33: error: type 'int' cannot be used prior to '::' +// CHECK-C: {{^}}malformed.cpp:[[@LINE-5]]:15: note: in instantiation of |