brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.9 KiB · 3694bdd Raw
60 lines · cpp
1// RUN: rm -rf %t.dir/misc-header-include-cycle-headers2// RUN: mkdir -p %t.dir/misc-header-include-cycle-headers3// RUN: cp -r %S/Inputs/header-include-cycle* %t.dir/misc-header-include-cycle-headers/4// RUN: mkdir %t.dir/misc-header-include-cycle-headers/system5// RUN: cp -r %S/Inputs/system/header-include-cycle* %t.dir/misc-header-include-cycle-headers/system6// RUN: cp %s %t.dir/header-include-cycle.cpp7// RUN: clang-tidy %t.dir%{fs-sep}header-include-cycle.cpp -checks='-*,misc-header-include-cycle' -header-filter=.* \8// RUN: -config="{CheckOptions: {misc-header-include-cycle.IgnoredFilesList: 'header-include-cycle.self-e.hpp'}}" \9// RUN: -- -I%t.dir%{fs-sep}misc-header-include-cycle-headers -isystem %t.dir%{fs-sep}misc-header-include-cycle-headers%{fs-sep}system \10// RUN: --include %t.dir%{fs-sep}misc-header-include-cycle-headers%{fs-sep}header-include-cycle.self-i.hpp | FileCheck %s \11// RUN: -check-prefix=CHECK-MESSAGES "-implicit-check-not={{note|warning|error}}:" --dump-input=fail12// RUN: rm -rf %t.dir/misc-header-include-cycle-headers13 14#ifndef MAIN_GUARD15#define MAIN_GUARD16 17#include "header-include-cycle.cpp"18// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: direct self-inclusion of header file 'header-include-cycle.cpp' [misc-header-include-cycle]19 20#include <header-include-cycle.first-d.hpp>21// CHECK-MESSAGES: header-include-cycle.fourth-d.hpp:3:10: warning: circular header file dependency detected while including 'header-include-cycle.first-d.hpp', please check the include path [misc-header-include-cycle]22// CHECK-MESSAGES: header-include-cycle.third-d.hpp:3:10: note: 'header-include-cycle.fourth-d.hpp' included from here23// CHECK-MESSAGES: header-include-cycle.second-d.hpp:3:10: note: 'header-include-cycle.third-d.hpp' included from here24// CHECK-MESSAGES: header-include-cycle.first-d.hpp:3:10: note: 'header-include-cycle.second-d.hpp' included from here25// CHECK-MESSAGES: :[[@LINE-5]]:10: note: 'header-include-cycle.first-d.hpp' included from here26 27#include <header-include-cycle.first.hpp>28// CHECK-MESSAGES: header-include-cycle.fourth.hpp:2:10: warning: circular header file dependency detected while including 'header-include-cycle.first.hpp', please check the include path [misc-header-include-cycle]29// CHECK-MESSAGES: header-include-cycle.third.hpp:2:10: note: 'header-include-cycle.fourth.hpp' included from here30// CHECK-MESSAGES: header-include-cycle.second.hpp:2:10: note: 'header-include-cycle.third.hpp' included from here31// CHECK-MESSAGES: header-include-cycle.first.hpp:2:10: note: 'header-include-cycle.second.hpp' included from here32// CHECK-MESSAGES: :[[@LINE-5]]:10: note: 'header-include-cycle.first.hpp' included from here33 34#include <header-include-cycle.self-d.hpp>35// CHECK-MESSAGES: header-include-cycle.self-d.hpp:3:10: warning: direct self-inclusion of header file 'header-include-cycle.self-d.hpp' [misc-header-include-cycle]36 37// CHECK-MESSAGES: header-include-cycle.self-i.hpp:2:10: warning: direct self-inclusion of header file 'header-include-cycle.self-i.hpp' [misc-header-include-cycle]38 39#include <header-include-cycle.self-o.hpp>40// CHECK-MESSAGES: header-include-cycle.self-n.hpp:2:10: warning: direct self-inclusion of header file 'header-include-cycle.self-n.hpp' [misc-header-include-cycle]41 42#include <header-include-cycle.self.hpp>43// CHECK-MESSAGES: header-include-cycle.self.hpp:2:10: warning: direct self-inclusion of header file 'header-include-cycle.self.hpp' [misc-header-include-cycle]44 45// Should not warn about second include of guarded headers:46#include <header-include-cycle.first.hpp>47#include <header-include-cycle.first-d.hpp>48#include <header-include-cycle.self.hpp>49#include <header-include-cycle.self-d.hpp>50#include <header-include-cycle.self-o.hpp>51#include <header-include-cycle.self-n.hpp>52 53// Should not warn about system includes54#include <header-include-cycle.first-s.hpp>55#include <header-include-cycle.self-s.hpp>56 57// Should not warn about this excluded header58#include <header-include-cycle.self-e.hpp>59#endif60