Files
llvm-project/clang-tools-extra/test/clang-rename/MemberExprMacro.cpp
Kirill Bobyrev 77f522cb42 [clang-rename] merge tests when possible
The only difference between some tests is -offset passed to clang-rename. It
makes sense to merge them into a single file and add multiple tool invocations.

Reviewers: alexfh

Differential Revision: https://reviews.llvm.org/D23158

llvm-svn: 278221
2016-08-10 13:28:30 +00:00

23 lines
584 B
C++

class Baz {
public:
int Foo; /* Test 1 */ // CHECK: int Bar;
};
int qux(int x) { return 0; }
#define MACRO(a) qux(a)
int main() {
Baz baz;
baz.Foo = 1; /* Test 2 */ // CHECK: baz.Bar = 1;
MACRO(baz.Foo); // CHECK: MACRO(baz.Bar);
int y = baz.Foo; // CHECK: int y = baz.Bar;
}
// Test 1.
// RUN: clang-rename -offset=26 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
// Test 2.
// RUN: clang-rename -offset=155 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
// To find offsets after modifying the file, use:
// grep -Ubo 'Foo.*' <file>