brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · ff7c66b Raw
25 lines · cpp
1// RUN: rm -rf %t.dir/Headers2// RUN: mkdir -p %t.dir/Headers3// RUN: cp -r %S/Inputs/restrict-system-includes %t.dir/Headers/portability-restrict-system-includes4// RUN: %check_clang_tidy -std=c++11 %s portability-restrict-system-includes %t \5// RUN:   -- -config="{CheckOptions: {portability-restrict-system-includes.Includes: 'transitive.h,s.h'}}" \6// RUN:   -system-headers -header-filter=.* \7// RUN:   -- -I %t.dir/Headers/portability-restrict-system-includes -isystem %t.dir/Headers/portability-restrict-system-includes/system8// RUN: FileCheck -input-file=%t.dir/Headers/portability-restrict-system-includes/transitive2.h %s -check-prefix=CHECK-FIXES9// RUN: rm -rf %t.dir/Headers10// FIXME: Make the test work in all language modes.11 12// transitive.h includes <r.h> and <t.h>13#include <transitive.h>14// CHECK-MESSAGES: :1:1: warning: system include r.h not allowed, transitively included from {{.*}}15// CHECK-MESSAGES: :2:1: warning: system include t.h not allowed, transitively included from {{.*}}16 17// transitive.h includes <s.h> and <t.h>18#include "transitive2.h"19// CHECK-MESSAGES: :2:1: warning: system include t.h not allowed, transitively included from {{.*}}20// CHECK-FIXES-NOT: #include <t.h>21 22int main() {23  // f() is declared in r.h24}25