system-header-line-directive.c 994 B

1234567891011121314151617181920212223
  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>
  5. // expected-warning@line-directive.h:* {{type specifier missing, defaults to 'int'}}
  6. #include "line-directive.h"
  7. // This tests that "#line" directives in system headers preserve system
  8. // header-ness just like GNU line markers that don't have filenames. This was
  9. // PR30752.
  10. // CHECK: # {{[0-9]+}} "{{.*}}system-header-line-directive.c" 2
  11. // CHECK: # 1 "{{.*}}noline.h" 1 3
  12. // CHECK: foo();
  13. // CHECK: # 4 "{{.*}}system-header-line-directive.c" 2
  14. // CHECK: # 1 "{{.*}}line-directive-in-system.h" 1 3
  15. // The "3" below indicates that "foo.h" is considered a system header.
  16. // CHECK: # 1 "foo.h" 3
  17. // CHECK: foo();
  18. // CHECK: # {{[0-9]+}} "{{.*}}system-header-line-directive.c" 2
  19. // CHECK: # 1 "{{.*}}line-directive.h" 1
  20. // CHECK: # 10 "foo.h"{{$}}