llvm-capstone/clang/test/clang-rename/MemberExprMacro.cpp
Alex Lorenz 4abbd92bf4 [refactor] Move clang-rename into the clang repository
The core engine of clang-rename will be used for local and global renames in the
new refactoring engine, as mentioned in
http://lists.llvm.org/pipermail/cfe-dev/2017-June/054286.html.

The clang-rename tool is still supported but might get deprecated in the future.

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

llvm-svn: 306840
2017-06-30 16:36:09 +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>