1 //===--- computed_include.cc - test input file for iwyu -------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // Tests computed #includes, i.e. #includes with macros. 11 12 #include "tests/cxx/computed_include.h" 13 14 // Test macro defined in another file. 15 #include MACRO_INC 16 // Test when #include with macro from another file is skipped. 17 #include MACRO_INC 18 19 // Macros with angle brackets differ from macros with quotation marks: the last 20 // include token is '>' and '"foo.h"' respectively. 21 #define MACRO_ANGLED_INC <stdio.h> 22 #include MACRO_ANGLED_INC 23 // And test how such #include is skipped. 24 #include MACRO_ANGLED_INC 25 26 // Test macro with arguments. 27 #define STRINGIZE(x) #x 28 #include STRINGIZE(tests/cxx/computed_include.h) 29 30 IndirectClass ic; 31 32 /**** IWYU_SUMMARY 33 34 tests/cxx/computed_include.cc should add these lines: 35 36 tests/cxx/computed_include.cc should remove these lines: 37 - #include "tests/cxx/computed_include.h" // lines XX-XX 38 - #include <stdio.h> // lines XX-XX 39 - #include <stdio.h> // lines XX-XX 40 - #include "tests/cxx/indirect.h" // lines XX-XX 41 42 The full include-list for tests/cxx/computed_include.cc: 43 #include "tests/cxx/computed_include.h" 44 #include "tests/cxx/indirect.h" // for IndirectClass 45 46 ***** IWYU_SUMMARY */ 47