<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54410>54410</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LibTooling cannot correctly find header files with the same name in different folder when running on multiple source files
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          PHIKN1GHT
      </td>
    </tr>
</table>

<pre>
    If we have `a\a.c`:
```c
#include "aaaaa.h"
#include "stdio.h"
extern void hello_e();
int main() {
  hello_e();
  printf("%f\n", PI);
  return 0;
}
```

and `b\b.c`:
```c
#include "aaaaa.h"
#include <stdio.h>

void hello_e() { printf("%f\n", M_E); }
```

and `a/aa/aaaaa.h`
```c
#define PI 3.14
```

and `b/aaaaa.h`
```c
#include <math.h>
// to use M_E
```

With a simple Makefile:
```Makefile
current_dir = $(shell pwd)
all:
        cd $(current_dir)/b && gcc -c b.c -o b
        cd $(current_dir)/a && gcc -Iaa a.c -o ../test ../b/b
```

After using `bear -- make`, 
Check these two files with: `clang-check a/a.c b/b.c`
Then clang-check will complain for:
```
warning: ../b/b: 'linker' input unused [-Wunused-command-line-argument]
b.c:1:10: fatal error: 'aaaaa.h' file not found
#include "aaaaa.h"
         ^~~~~~~~~
1 error generated.
Error while processing testcase/b/b.c.
```
In which it seems failed to find the `b/aaaaa.h` for `b/b.c`. 
Is this an intented behavior or just a bug? What is the correct way to use clang-check (or use libtooling) to do CTU analyze on multiple source files?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVUtz4jgQ_jXm0mWX8QPDwYcMCTvU7mzNIVM5pmS5jTUREiXJ8WZ-_bZkSJhh2OKwlDBSq59ff20a3b7V2w5GhJ69IkSLlEXlmiWcdlF-F6X3UXrn92Hx4znLheJyaMkgy5j_JD3tfndrXSv02S3-49AoeNWihR6l1M8YZcsoW0X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