[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Frontend / system-header-line-directive.c
blobd5705e028daa564b327d8bad610ff003c2861b14
1 // RUN: %clang_cc1 -Wall %s -I %S/Inputs -isystem %S/Inputs/SystemHeaderPrefix -verify
2 // RUN: %clang_cc1 %s -E -o - -I %S/Inputs -isystem %S/Inputs/SystemHeaderPrefix | FileCheck %s
3 #include <noline.h>
4 #include <line-directive-in-system.h>
6 // expected-error@line-directive.h:* {{type specifier missing, defaults to 'int'}}
7 #include "line-directive.h"
9 // This tests that "#line" directives in system headers preserve system
10 // header-ness just like GNU line markers that don't have filenames. This was
11 // PR30752.
13 // CHECK: # {{[0-9]+}} "{{.*}}system-header-line-directive.c" 2
14 // CHECK: # 1 "{{.*}}noline.h" 1 3
15 // CHECK: foo(void);
16 // CHECK: # 4 "{{.*}}system-header-line-directive.c" 2
17 // CHECK: # 1 "{{.*}}line-directive-in-system.h" 1 3
18 // The "3" below indicates that "foo.h" is considered a system header.
19 // CHECK: # 1 "foo.h" 3
20 // CHECK: foo(void);
21 // CHECK: # {{[0-9]+}} "{{.*}}system-header-line-directive.c" 2
22 // CHECK: # 1 "{{.*}}line-directive.h" 1
23 // CHECK: # 10 "foo.h"{{$}}