[Lldb-commits] [lldb] r300046 - Fix TestGuessLanguage for gcc

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 12 03:13:51 PDT 2017


Author: labath
Date: Wed Apr 12 05:13:50 2017
New Revision: 300046

URL: http://llvm.org/viewvc/llvm-project?rev=300046&view=rev
Log:
Fix TestGuessLanguage for gcc

gcc emits DW_LANG_C89 even if we specify -std=c99 during compilation.
Since this isn't an lldb bug, but just the way the compiler happens to
be implemented, I teach the test to expect this situation correctly.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py?rev=300046&r1=300045&r2=300046&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py Wed Apr 12 05:13:50 2017
@@ -73,7 +73,13 @@ class TestFrameGuessLanguage(TestBase):
         self.assertTrue(breakpoint.GetHitCount() == 1)
 
         thread = threads[0]
-        self.check_language(thread, 0, lldb.eLanguageTypeC99)
+
+        c_frame_language = lldb.eLanguageTypeC99
+        # gcc emits DW_LANG_C89 even if -std=c99 was specified
+        if "gcc" in self.getCompiler():
+            c_frame_language = lldb.eLanguageTypeC89
+
+        self.check_language(thread, 0, c_frame_language)
         self.check_language(thread, 1, lldb.eLanguageTypeC_plus_plus)
         self.check_language(thread, 2, lldb.eLanguageTypeC_plus_plus)
         




More information about the lldb-commits mailing list