From 323ca78604063b06c511d4661789526d1425a551 Mon Sep 17 00:00:00 2001 From: Eric Ludlam Date: Wed, 22 Apr 2015 20:58:59 -0400 Subject: [PATCH] New test file for unions. --- .../cedet/cedet/semantic/tests/testunion.cpp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/manual/cedet/cedet/semantic/tests/testunion.cpp diff --git a/test/manual/cedet/cedet/semantic/tests/testunion.cpp b/test/manual/cedet/cedet/semantic/tests/testunion.cpp new file mode 100644 index 00000000000..8e2d944b049 --- /dev/null +++ b/test/manual/cedet/cedet/semantic/tests/testunion.cpp @@ -0,0 +1,28 @@ +// Test unions and completion. + +struct myStruct { + int base1; + int base2; + + union { // Named + char *named_str; + void *named_ptr; + } allocated; + + union { // Anonymous + char *anon_str; + void *anon_ptr; + }; + +}; + +int main() { + struct myStruct S; + + S.//-1- + ; // #1# ( "allocated" "base1" "base2" "anon_str" "anon_ptr" ) + + S.allocated.//-2- + ; // #2# ( "named_str" "named_ptr" ) + +} -- 2.39.2