]> git.eshelyaron.com Git - emacs.git/commitdiff
New test file for unions.
authorEric Ludlam <eric@siege-engine.com>
Thu, 23 Apr 2015 00:58:59 +0000 (20:58 -0400)
committerEdward John Steere <edward.steere@gmail.com>
Wed, 25 Jan 2017 17:04:09 +0000 (19:04 +0200)
test/manual/cedet/cedet/semantic/tests/testunion.cpp [new file with mode: 0644]

diff --git a/test/manual/cedet/cedet/semantic/tests/testunion.cpp b/test/manual/cedet/cedet/semantic/tests/testunion.cpp
new file mode 100644 (file)
index 0000000..8e2d944
--- /dev/null
@@ -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" )
+
+}