rewrite-includes-line-markers.c 1.1 KB

123456789101112131415161718192021222324252627282930
  1. // RUN: %clang_cc1 -E -frewrite-includes -I %S/Inputs %s | FileCheck %s --check-prefix=GNU
  2. // RUN: %clang_cc1 -E -frewrite-includes -fuse-line-directives -I %S/Inputs %s | FileCheck %s --check-prefix=LINE
  3. #include "test.h"
  4. int f() { return x; }
  5. #include "empty.h"
  6. // GNU: {{^}}# 1 "{{.*}}rewrite-includes-line-markers.c"
  7. // GNU: {{^}}#include "test.h"
  8. // GNU: {{^}}# 1 "{{.*}}test.h"
  9. // GNU: {{^}}#include "test2.h"
  10. // GNU: {{^}}# 1 "{{.*}}test2.h"
  11. // GNU: {{^}}int x;
  12. // GNU: {{^}}# 4 "{{.*}}rewrite-includes-line-markers.c" 2
  13. // GNU: {{^}}int f() { return x; }
  14. // GNU: {{^}}
  15. // GNU: {{^}}# 1 "{{.*}}empty.h" 1
  16. // GNU: {{^}}# 7 "{{.*}}rewrite-includes-line-markers.c" 2
  17. // LINE: {{^}}#line 1 "{{.*}}rewrite-includes-line-markers.c"
  18. // LINE: {{^}}#include "test.h"
  19. // LINE: {{^}}#line 1 "{{.*}}test.h"
  20. // LINE: {{^}}#include "test2.h"
  21. // LINE: {{^}}#line 1 "{{.*}}test2.h"
  22. // LINE: {{^}}int x;
  23. // LINE: {{^}}#line 4 "{{.*}}rewrite-includes-line-markers.c"
  24. // LINE: {{^}}int f() { return x; }
  25. // LINE: {{^}}
  26. // LINE: {{^}}#line 1 "{{.*}}empty.h"
  27. // LINE: {{^}}#line 7 "{{.*}}rewrite-includes-line-markers.c"