[Lldb-commits] [lldb] 0803241 - [lldb] Enable TestFrameFormatNameWithArgs in case of cross compilation

Ayush Sahay via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 1 09:35:39 PST 2023


Author: Ayush Sahay
Date: 2023-02-01T23:05:28+05:30
New Revision: 08032411301e8996879c4b558b8bb3808d5dfe6f

URL: https://github.com/llvm/llvm-project/commit/08032411301e8996879c4b558b8bb3808d5dfe6f
DIFF: https://github.com/llvm/llvm-project/commit/08032411301e8996879c4b558b8bb3808d5dfe6f.diff

LOG: [lldb] Enable TestFrameFormatNameWithArgs in case of cross compilation

TestFrameFormatNameWithArgs.test is enabled only in case of native
compilation but is applicable in case of cross compilation too. So,
provision support for enabling it in case of both, native and cross
compilation.

Reviewed By: Michael137

Differential Revision: https://reviews.llvm.org/D140839

Added: 
    

Modified: 
    lldb/test/Shell/Settings/TestFrameFormatNameWithArgs.test
    lldb/test/Shell/helper/build.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/Shell/Settings/TestFrameFormatNameWithArgs.test b/lldb/test/Shell/Settings/TestFrameFormatNameWithArgs.test
index dc4dedadee80a..eeb46cfd6bf9d 100644
--- a/lldb/test/Shell/Settings/TestFrameFormatNameWithArgs.test
+++ b/lldb/test/Shell/Settings/TestFrameFormatNameWithArgs.test
@@ -1,5 +1,5 @@
 # UNSUPPORTED: system-windows
-# RUN: %clangxx_host -g -O0 %S/Inputs/names.cpp -std=c++17 -o %t.out
+# RUN: %build %S/Inputs/names.cpp --std c++17 -o %t.out
 # RUN: %lldb -b -s %s %t.out | FileCheck %s
 settings set -f frame-format "frame ${function.name-with-args}\n"
 break set -n foo

diff  --git a/lldb/test/Shell/helper/build.py b/lldb/test/Shell/helper/build.py
index 96684b7b3e669..55d871f2a0400 100755
--- a/lldb/test/Shell/helper/build.py
+++ b/lldb/test/Shell/helper/build.py
@@ -110,6 +110,12 @@
                     nargs='+',
                     help='Source file(s) to compile / object file(s) to link')
 
+parser.add_argument('--std',
+                    metavar='std',
+                    dest='std',
+                    required=False,
+                    help='Specify the C/C++ standard.')
+
 
 args = parser.parse_args(args=sys.argv[1:])
 
@@ -231,6 +237,7 @@ def __init__(self, toolchain_type, args, obj_ext):
         self.verbose = args.verbose
         self.obj_ext = obj_ext
         self.lib_paths = args.libs_dir
+        self.std = args.std
 
     def _exe_file_name(self):
         assert self.mode != 'compile'
@@ -581,6 +588,9 @@ def _get_compilation_command(self, source, obj):
             args.append('--')
         args.append(source)
 
+        if self.std:
+            args.append('/std:' + self.std)
+
         return ('compiling', [source], obj,
                 self.compile_env,
                 args)
@@ -652,6 +662,9 @@ def _get_compilation_command(self, source, obj):
         if sys.platform == 'darwin':
             args.extend(['-isysroot', self.apple_sdk])
 
+        if self.std:
+            args.append('-std={0}'.format(self.std))
+
         return ('compiling', [source], obj, None, args)
 
     def _get_link_command(self):
@@ -789,6 +802,7 @@ def fix_arguments(args):
     print('  Verbose: ' + str(args.verbose))
     print('  Dryrun: ' + str(args.dry))
     print('  Inputs: ' + format_text(args.inputs, 0, 10))
+    print('  C/C++ Standard: ' + str(args.std))
     print('Script Environment:')
     print_environment(os.environ)
 


        


More information about the lldb-commits mailing list