Revert "[LoongArch] Eliminate the redundant sign extension of division (#107971)"
[llvm-project.git] / lldb / test / API / use_lldb_suite.py
bloba680f8c466a34f0c70b7101a687b1ee182fd857e
1 import inspect
2 import os
3 import sys
6 def find_lldb_root():
7 lldb_root = os.path.realpath(
8 os.path.dirname(inspect.getfile(inspect.currentframe()))
10 while True:
11 parent = os.path.dirname(lldb_root)
12 if parent == lldb_root: # dirname('/') == '/'
13 raise Exception("use_lldb_suite_root.py not found")
14 lldb_root = parent
16 test_path = os.path.join(lldb_root, "use_lldb_suite_root.py")
17 if os.path.isfile(test_path):
18 return lldb_root
21 lldb_root = find_lldb_root()
23 import importlib.machinery
24 import importlib.util
26 path = os.path.join(lldb_root, "use_lldb_suite_root.py")
27 loader = importlib.machinery.SourceFileLoader("use_lldb_suite_root", path)
28 spec = importlib.util.spec_from_loader("use_lldb_suite_root", loader=loader)
29 module = importlib.util.module_from_spec(spec)
30 loader.exec_module(module)