blob: 65025bd386798f53cc8cb3db30bac6c9c2682513 [file] [log] [blame]
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file (and other gen-*-test.cc files) tests generation of output for
// --field-filter-file and therefore the expectations file
// (gen-return-ref-expected.txt) needs to be compared against the raw output of
// the rewriter (rather than against the actual edits result). This makes the
// test incompatible with other tests, which require passing --apply-edits
// switch to test_tool.py and so to disable the test it is named *-test.cc
// rather than *-original.cc.
//
// To run the test use tools/clang/rewrite_raw_ptr_fields/tests/run_all_tests.sh
#include <stdint.h>
namespace my_namespace {
class SomeClass;
struct MyStruct {
SomeClass* ptr_field;
};
class MyClass {
SomeClass* ptr_field;
};
union MyUnion1 {
SomeClass* some_class_ptr;
const char* char_ptr;
};
union MyUnion2 {
SomeClass* some_class_ptr;
uintptr_t uintptr;
};
union MyUnion3 {
SomeClass* some_class_ptr;
SomeClass* some_class_ptr2;
};
struct MyNestedStruct {
SomeClass* ptr_field;
};
union MyUnion4 {
MyNestedStruct nested_struct;
uintptr_t uintptr;
};
} // namespace my_namespace