[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Frontend / dependency-gen.c
blobda3ac4f3adbd670c1548edb965425f9484c9d949
1 // Basic test
2 // RUN: rm -rf %t.dir
3 // RUN: mkdir -p %t.dir/a/b
4 // RUN: echo > %t.dir/a/b/x.h
5 // RUN: cd %t.dir
6 // RUN: %clang -MD -MF - %s -fsyntax-only -I a/b | FileCheck -check-prefix=CHECK-ONE %s
7 // CHECK-ONE: {{ }}a{{[/\\]}}b{{[/\\]}}x.h
9 // PR8974 (-include flag)
10 // RUN: %clang -MD -MF - %s -fsyntax-only -include a/b/x.h -DINCLUDE_FLAG_TEST | FileCheck -check-prefix=CHECK-TWO %s
11 // CHECK-TWO: {{ }}a{{[/\\]}}b{{[/\\]}}x.h
13 // RUN: %clang -MD -MF - %s -fsyntax-only -I ./a/b | FileCheck -check-prefix=CHECK-THREE %s
14 // CHECK-THREE: {{ }}a{{[/\\]}}b{{[/\\]}}x.h
15 // RUN: %clang -MD -MF - %s -fsyntax-only -I .//./a/b/ | FileCheck -check-prefix=CHECK-FOUR %s
16 // CHECK-FOUR: {{ }}a{{[/\\]}}b{{[/\\]}}x.h
17 // RUN: %clang -MD -MF - %s -fsyntax-only -I a/b/. | FileCheck -check-prefix=CHECK-FIVE %s
18 // CHECK-FIVE: {{ }}a{{[/\\]}}b{{[/\\]}}.{{[/\\]}}x.h
19 // RUN: cd a/b
20 // RUN: %clang -MD -MF - %s -fsyntax-only -I ./ | FileCheck -check-prefix=CHECK-SIX %s
21 // CHECK-SIX: {{ }}x.h
22 // RUN: echo "fun:foo" > %t.ignorelist
23 // RUN: %clang -MD -MF - %s -fsyntax-only -resource-dir=%S/Inputs/resource_dir_with_sanitizer_ignorelist -fsanitize=undefined -flto -fvisibility=hidden -fsanitize-ignorelist=%t.ignorelist -I ./ | FileCheck -check-prefix=CHECK-SEVEN %s
24 // CHECK-SEVEN: .ignorelist
25 // CHECK-SEVEN: {{ }}x.h
26 #ifndef INCLUDE_FLAG_TEST
27 #include <x.h>
28 #endif
30 // RUN: echo "fun:foo" > %t.ignorelist1
31 // RUN: echo "fun:foo" > %t.ignorelist2
32 // RUN: %clang -MD -MF - %s -fsyntax-only -resource-dir=%S/Inputs/resource_dir_with_sanitizer_ignorelist -fsanitize=undefined -flto -fvisibility=hidden -fsanitize-ignorelist=%t.ignorelist1 -fsanitize-ignorelist=%t.ignorelist2 -I ./ | FileCheck -check-prefix=TWO-IGNORE-LISTS %s
33 // TWO-IGNORE-LISTS: dependency-gen.o:
34 // TWO-IGNORE-LISTS-DAG: ignorelist1
35 // TWO-IGNORE-LISTS-DAG: ignorelist2
36 // TWO-IGNORE-LISTS-DAG: x.h
37 // TWO-IGNORE-LISTS-DAG: dependency-gen.c
39 // RUN: %clang -MD -MF - %s -fsyntax-only -resource-dir=%S/Inputs/resource_dir_with_sanitizer_ignorelist -fsanitize=undefined -flto -fvisibility=hidden -I ./ | FileCheck -check-prefix=USER-AND-SYS-DEPS %s
40 // USER-AND-SYS-DEPS: dependency-gen.o:
41 // USER-AND-SYS-DEPS-DAG: ubsan_ignorelist.txt
43 // RUN: %clang -MMD -MF - %s -fsyntax-only -resource-dir=%S/Inputs/resource_dir_with_sanitizer_ignorelist -fsanitize=undefined -flto -fvisibility=hidden -I ./ | FileCheck -check-prefix=ONLY-USER-DEPS %s
44 // ONLY-USER-DEPS: dependency-gen.o:
45 // NOT-ONLY-USER-DEPS: ubsan_ignorelist.txt