48 lines · c
1// RUN: rm -rf %t2// RUN: split-file %s %t3// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json4 5// RUN: clang-scan-deps -compilation-database %t/cdb.json | FileCheck %s6 7// CHECK: t.c8// CHECK: top.h9// CHECK: n1.h10// CHECK: n2.h11// CHECK: n3.h12 13//--- cdb.json.template14[15 {16 "directory": "DIR",17 "command": "clang -fsyntax-only DIR/t.c",18 "file": "DIR/t.c"19 }20]21 22//--- t.c23 24#include "top.h"25#define INCLUDE_N326#include "top.h"27 28//--- top.h29#ifndef _TOP_H_30#define _TOP_H_31 32#include "n1.h"33 34#endif35 36// More stuff after following '#endif', should invalidate the macro guard optimization,37// and allow `top.h` to get re-included.38#include "n2.h"39 40//--- n1.h41 42//--- n2.h43#ifdef INCLUDE_N344#include "n3.h"45#endif46 47//--- n3.h48