Reid Kleckner | eb00ee0 | 2017-05-22 21:42:58 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -Wall %s -isystem %S/Inputs/SystemHeaderPrefix -verify |
| 2 | // RUN: %clang_cc1 %s -E -o - -isystem %S/Inputs/SystemHeaderPrefix | FileCheck %s |
| 3 | #include <noline.h> |
| 4 | #include <line.h> |
| 5 | |
| 6 | // This tests that "#line" directives in system headers preserve system |
| 7 | // header-ness just like GNU line markers that don't have filenames. This was |
| 8 | // PR30752. |
| 9 | |
| 10 | // expected-no-diagnostics |
| 11 | |
| 12 | // CHECK: # {{[0-9]+}} "{{.*}}system-header-line-directive.c" 2 |
| 13 | // CHECK: # 1 "{{.*}}noline.h" 1 3 |
| 14 | // CHECK: foo(); |
| 15 | // CHECK: # 4 "{{.*}}system-header-line-directive.c" 2 |
| 16 | // CHECK: # 1 "{{.*}}line.h" 1 3 |
| 17 | // The "3" below indicates that "foo.h" is considered a system header. |
| 18 | // CHECK: # 1 "foo.h" 3 |
| 19 | // CHECK: foo(); |
| 20 | // CHECK: # {{[0-9]+}} "{{.*}}system-header-line-directive.c" 2 |