Added a couple more gdb-remote tests to ensure qProcessInfo on darwin is not defining triple.

And likewise for qProcessInfo on Linux, but ensures cputype/cpusubtype is not defined.  The
Apple case is the more important one, since we take a slightly different path to initialize
ProcessGDBRemote-related remote host/process info if triple is present.

Related to http://llvm.org/bugs/show_bug.cgi?id=20755.

llvm-svn: 216473
diff --git a/lldb/test/tools/lldb-gdbserver/TestGdbRemoteProcessInfo.py b/lldb/test/tools/lldb-gdbserver/TestGdbRemoteProcessInfo.py
index 6857b6a..17209e2 100644
--- a/lldb/test/tools/lldb-gdbserver/TestGdbRemoteProcessInfo.py
+++ b/lldb/test/tools/lldb-gdbserver/TestGdbRemoteProcessInfo.py
@@ -128,6 +128,26 @@
 
         self.assertEquals(missing_key_set, set(), "the listed keys are missing in the qProcessInfo result")
 
+    def qProcessInfo_does_not_contain_keys(self, absent_key_set):
+        procs = self.prep_debug_monitor_and_inferior()
+        self.add_process_info_collection_packets()
+
+        # Run the stream
+        context = self.expect_gdbremote_sequence()
+        self.assertIsNotNone(context)
+
+        # Gather process info response
+        process_info = self.parse_process_info_response(context)
+        self.assertIsNotNone(process_info)
+
+        # Ensure the unexpected keys are not present
+        unexpected_key_set = set()
+        for unexpected_key in absent_key_set:
+            if unexpected_key in process_info:
+                unexpected_key_set.add(unexpected_key)
+
+        self.assertEquals(unexpected_key_set, set(), "the listed keys were present but unexpected in qProcessInfo result")
+
     @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @debugserver_test
     @dsym_test
@@ -144,6 +164,25 @@
         self.buildDwarf()
         self.qProcessInfo_contains_keys(set(['triple']))
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @debugserver_test
+    @dsym_test
+    def test_qProcessInfo_does_not_contain_triple_debugserver_darwin(self):
+        self.init_debugserver_test()
+        self.buildDsym()
+        # We don't expect to see triple on darwin.  If we do, we'll prefer triple
+        # to cputype/cpusubtype and skip some darwin-based ProcessGDBRemote ArchSpec setup
+        # for the remote Host and Process.
+        self.qProcessInfo_does_not_contain_keys(set(['triple']))
+
+    @unittest2.skipUnless(sys.platform.startswith("linux"), "requires Linux")
+    @llgs_test
+    @dwarf_test
+    def test_qProcessInfo_does_not_contain_cputype_cpusubtype_llgs_linux(self):
+        self.init_llgs_test()
+        self.buildDwarf()
+        self.qProcessInfo_does_not_contain_keys(set(['cputype', 'cpusubtype']))
+
 
 if __name__ == '__main__':
     unittest2.main()