brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 3cc77b4 Raw
16 lines · cpp
1// RUN: echo "foo f;" > %t.cpp2// RUN: clang-include-fixer -db=fixed -input='foo= "foo.h","bar.h"' -output-headers %t.cpp -- | FileCheck %s3// RUN: cat %t.cpp | clang-include-fixer -stdin -insert-header='{FilePath: "%/t.cpp", QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "foo"}]}' %t.cpp | FileCheck %s -check-prefix=CHECK-CODE4// RUN: cat %t.cpp | not clang-include-fixer -stdin -insert-header='{FilePath: "%/t.cpp", QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "foo"},{Header: "\"foo2.h\"", QualifiedName: "foo"}]}' %t.cpp5// RUN: cat %t.cpp | clang-include-fixer -stdin -insert-header='{FilePath: "%/t.cpp", QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "a:foo"},{Header: "\"foo.h\"", QualifiedName: "b:foo"}]}' %t.cpp6//7// CHECK:     "HeaderInfos": [8// CHECK-NEXT:  {"Header": "\"foo.h\"",9// CHECK-NEXT:   "QualifiedName": "foo"},10// CHECK-NEXT:  {"Header": "\"bar.h\"",11// CHECK-NEXT:   "QualifiedName": "foo"}12// CHECK-NEXT:]13//14// CHECK-CODE: #include "foo.h"15// CHECK-CODE: foo f;16