diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-13 20:27:03 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-13 20:27:03 +0000 |
commit | 8acadcb84bcb70e1eea08cf261a2f4f5973578c3 (patch) | |
tree | 84f91fcb648badaf8014efa8581c738d40368d06 /clang/test/Frontend | |
parent | dc3559106b15c8b44355560ec5203f0a1b441d69 (diff) | |
download | bcm5719-llvm-8acadcb84bcb70e1eea08cf261a2f4f5973578c3.tar.gz bcm5719-llvm-8acadcb84bcb70e1eea08cf261a2f4f5973578c3.zip |
Add -isystem-prefix and -ino-system-prefix arguments, which can be used to
override whether headers are system headers by checking for prefixes of the
header name specified in the #include directive.
This allows warnings to be disabled for third-party code which is found in
specific subdirectories of include paths.
llvm-svn: 158418
Diffstat (limited to 'clang/test/Frontend')
7 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/boost/all.h b/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/boost/all.h new file mode 100644 index 00000000000..0f3f0be3c76 --- /dev/null +++ b/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/boost/all.h @@ -0,0 +1 @@ +#include "warn.h" diff --git a/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/boost/warn.h b/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/boost/warn.h new file mode 100644 index 00000000000..def881aa137 --- /dev/null +++ b/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/boost/warn.h @@ -0,0 +1,2 @@ +#if BOOST +#endif diff --git a/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/mylib/all.h b/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/mylib/all.h new file mode 100644 index 00000000000..0f3f0be3c76 --- /dev/null +++ b/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/mylib/all.h @@ -0,0 +1 @@ +#include "warn.h" diff --git a/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/mylib/warn.h b/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/mylib/warn.h new file mode 100644 index 00000000000..6a0c102ea45 --- /dev/null +++ b/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/mylib/warn.h @@ -0,0 +1,2 @@ +#if MYLIB +#endif diff --git a/clang/test/Frontend/Inputs/SystemHeaderPrefix/src/all.h b/clang/test/Frontend/Inputs/SystemHeaderPrefix/src/all.h new file mode 100644 index 00000000000..ace9699f85b --- /dev/null +++ b/clang/test/Frontend/Inputs/SystemHeaderPrefix/src/all.h @@ -0,0 +1,6 @@ +#include "libs/boost/all.h" +#include "libs/mylib/all.h" + +#include "libs/boost/warn.h" +#include "libs/mylib/warn.h" +#include "src/warn.h" diff --git a/clang/test/Frontend/Inputs/SystemHeaderPrefix/src/warn.h b/clang/test/Frontend/Inputs/SystemHeaderPrefix/src/warn.h new file mode 100644 index 00000000000..91e2591855e --- /dev/null +++ b/clang/test/Frontend/Inputs/SystemHeaderPrefix/src/warn.h @@ -0,0 +1,2 @@ +#if SRC +#endif diff --git a/clang/test/Frontend/system-header-prefix.c b/clang/test/Frontend/system-header-prefix.c new file mode 100644 index 00000000000..31194d96e58 --- /dev/null +++ b/clang/test/Frontend/system-header-prefix.c @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -isystem-prefix libs/ -ino-system-prefix libs/mylib/ -I%S/Inputs/SystemHeaderPrefix -Wundef -E %s 2>&1 | FileCheck %s + +#include "src/all.h" + +// CHECK-NOT: BOOST +// CHECK: libs/mylib/warn.h:1:5: warning: 'MYLIB' is not defined, evaluates to 0 +// CHECK-NOT: BOOST +// CHECK: libs/mylib/warn.h:1:5: warning: 'MYLIB' is not defined, evaluates to 0 +// CHECK-NOT: BOOST +// CHECK: src/warn.h:1:5: warning: 'SRC' is not defined, evaluates to 0 +// CHECK-NOT: BOOST |