2018-05-12 05:28:34 +08:00
|
|
|
// RUN: rm -rf %T/Headers
|
|
|
|
// RUN: mkdir %T/Headers
|
|
|
|
// RUN: cp -r %S/Inputs/fuchsia-restrict-system-includes %T/Headers/fuchsia-restrict-system-includes
|
2018-05-12 05:08:59 +08:00
|
|
|
// RUN: %check_clang_tidy %s fuchsia-restrict-system-includes %t \
|
|
|
|
// RUN: -- -config="{CheckOptions: [{key: fuchsia-restrict-system-includes.Includes, value: 'transitive.h,s.h'}]}" \
|
|
|
|
// RUN: -system-headers -header-filter=.* \
|
2018-05-12 05:28:34 +08:00
|
|
|
// RUN: -- -std=c++11 -I %T/Headers/fuchsia-restrict-system-includes -isystem %T/Headers/fuchsia-restrict-system-includes/system
|
|
|
|
// RUN: FileCheck -input-file=%T/Headers/fuchsia-restrict-system-includes/transitive2.h %s -check-prefix=CHECK-FIXES
|
|
|
|
// RUN: rm -rf %T/Headers
|
2018-05-12 05:08:59 +08:00
|
|
|
|
|
|
|
// transitive.h includes <r.h> and <t.h>
|
|
|
|
#include <transitive.h>
|
2018-05-12 06:58:45 +08:00
|
|
|
// CHECK-MESSAGES: :1:1: warning: system include r.h not allowed, transitively included from {{.*}}
|
|
|
|
// CHECK-MESSAGES: :2:1: warning: system include t.h not allowed, transitively included from {{.*}}
|
2018-05-12 05:08:59 +08:00
|
|
|
|
|
|
|
// transitive.h includes <s.h> and <t.h>
|
|
|
|
#include "transitive2.h"
|
2018-05-12 06:58:45 +08:00
|
|
|
// CHECK-MESSAGES: :2:1: warning: system include t.h not allowed, transitively included from {{.*}}
|
2018-05-12 05:08:59 +08:00
|
|
|
// CHECK-FIXES-NOT: #include <t.h>
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
// f() is declared in r.h
|
|
|
|
}
|