diff options
author | Giuliano Procida <gprocida@google.com> | 2023-11-30 17:24:20 +0000 |
---|---|---|
committer | Giuliano Procida <gprocida@google.com> | 2023-12-13 11:24:42 +0000 |
commit | d2f0adcb76772a94bf92b2dd6308c75b1b074074 (patch) | |
tree | 927eb3e815ea1483c5417f80d00f1a230b1d9647 | |
parent | b253c41955e7d1ad981ae868c4b04a392dcdbed2 (diff) | |
download | stg-d2f0adcb76772a94bf92b2dd6308c75b1b074074.tar.gz |
test cases: add a combined filter and type roots case
* the source filter should remove all type definitions (except for
`typedef`s where this is currently impossible)
* the symbol filter should remove all symbols (which are not interesting
here)
* type roots are requested (picking up all defined named types)
PiperOrigin-RevId: 586697229
Change-Id: I5a25805f8acb3488b644e42a54b512230a0ac883
-rw-r--r-- | test_cases/info_tests/source_filter/expected/type_roots_cc.elf_stg | 20 | ||||
-rw-r--r-- | test_cases/info_tests/source_filter/type_roots.cc | 30 |
2 files changed, 50 insertions, 0 deletions
diff --git a/test_cases/info_tests/source_filter/expected/type_roots_cc.elf_stg b/test_cases/info_tests/source_filter/expected/type_roots_cc.elf_stg new file mode 100644 index 0000000..2b219ca --- /dev/null +++ b/test_cases/info_tests/source_filter/expected/type_roots_cc.elf_stg @@ -0,0 +1,20 @@ +version: 0x00000002 +root_id: 0x84ea5130 +special { + id: 0x48b5725f + kind: VOID +} +pointer_reference { + id: 0x18bd6530 + kind: POINTER + pointee_type_id: 0x48b5725f +} +typedef { + id: 0x4f137329 + name: "Typedef" + referred_type_id: 0x18bd6530 +} +interface { + id: 0x84ea5130 + type_id: 0x4f137329 +} diff --git a/test_cases/info_tests/source_filter/type_roots.cc b/test_cases/info_tests/source_filter/type_roots.cc new file mode 100644 index 0000000..5d393dd --- /dev/null +++ b/test_cases/info_tests/source_filter/type_roots.cc @@ -0,0 +1,30 @@ +struct Struct { + long x; +}; + +union Union { + long y; +}; + +class Class { + long z; +}; + +enum Enum { + ENUM_ZERO = 0, + ENUM_ONE = 1, +}; + +enum class EnumClass { + ZERO = 0, + ONE = 1, +}; + +typedef void* Typedef; + +Struct foo_struct; +Union foo_union; +Class foo_class; +Enum foo_enum; +EnumClass foo_enum_class; +Typedef foo_typedef; |