forked from OSchip/llvm-project
Add test coverage for recent behavior change in GNU line marker pre-processing
llvm-svn: 303642
This commit is contained in:
parent
a96ec3f360
commit
1ace0049fe
|
@ -0,0 +1,2 @@
|
|||
#line 10 "foo.h"
|
||||
foo(); // will warn if not treated as a system header
|
|
@ -1,20 +1,23 @@
|
|||
// RUN: %clang_cc1 -Wall %s -isystem %S/Inputs/SystemHeaderPrefix -verify
|
||||
// RUN: %clang_cc1 %s -E -o - -isystem %S/Inputs/SystemHeaderPrefix | FileCheck %s
|
||||
// RUN: %clang_cc1 -Wall %s -I %S/Inputs -isystem %S/Inputs/SystemHeaderPrefix -verify
|
||||
// RUN: %clang_cc1 %s -E -o - -I %S/Inputs -isystem %S/Inputs/SystemHeaderPrefix | FileCheck %s
|
||||
#include <noline.h>
|
||||
#include <line.h>
|
||||
#include <line-directive-in-system.h>
|
||||
|
||||
// expected-warning@line-directive.h:* {{type specifier missing, defaults to 'int'}}
|
||||
#include "line-directive.h"
|
||||
|
||||
// This tests that "#line" directives in system headers preserve system
|
||||
// header-ness just like GNU line markers that don't have filenames. This was
|
||||
// PR30752.
|
||||
|
||||
// expected-no-diagnostics
|
||||
|
||||
// CHECK: # {{[0-9]+}} "{{.*}}system-header-line-directive.c" 2
|
||||
// CHECK: # 1 "{{.*}}noline.h" 1 3
|
||||
// CHECK: foo();
|
||||
// CHECK: # 4 "{{.*}}system-header-line-directive.c" 2
|
||||
// CHECK: # 1 "{{.*}}line.h" 1 3
|
||||
// CHECK: # 1 "{{.*}}line-directive-in-system.h" 1 3
|
||||
// The "3" below indicates that "foo.h" is considered a system header.
|
||||
// CHECK: # 1 "foo.h" 3
|
||||
// CHECK: foo();
|
||||
// CHECK: # {{[0-9]+}} "{{.*}}system-header-line-directive.c" 2
|
||||
// CHECK: # 1 "{{.*}}line-directive.h" 1
|
||||
// CHECK: # 10 "foo.h"{{$}}
|
||||
|
|
|
@ -76,3 +76,10 @@ extern int z;
|
|||
|
||||
// CHECK: # 50 "a\n.c"
|
||||
# 50 "a\012.c"
|
||||
|
||||
# 1 "system.h" 3
|
||||
# 2
|
||||
void sys_foo(void);
|
||||
// CHECK: # 1 "system.h" 3
|
||||
// CHECK-NEXT: # 2 "system.h" 3
|
||||
// CHECK-NEXT: void sys_foo(void);
|
||||
|
|
Loading…
Reference in New Issue