[AMDGPU] Add True16 register classes.
[llvm-project.git] / lldb / test / API / commands / command / script / callables.py
blob5fb7ad211eb91e501496715056196231d677d424
1 import lldb
3 # bunch of different kinds of python callables that should
4 # all work as commands.
7 def check(debugger, command, context, result, internal_dict):
8 if (
9 not isinstance(debugger, lldb.SBDebugger)
10 or not isinstance(command, str)
11 or not isinstance(result, lldb.SBCommandReturnObject)
12 or not isinstance(internal_dict, dict)
13 or (not context is None and not isinstance(context, lldb.SBExecutionContext))
15 raise Exception()
16 result.AppendMessage("All good.")
19 def vfoobar(*args):
20 check(*args)
23 def v5foobar(debugger, command, context, result, internal_dict, *args):
24 check(debugger, command, context, result, internal_dict)
27 def foobar(debugger, command, context, result, internal_dict):
28 check(debugger, command, context, result, internal_dict)
31 def foobar4(debugger, command, result, internal_dict):
32 check(debugger, command, None, result, internal_dict)
35 class FooBar:
36 @staticmethod
37 def sfoobar(debugger, command, context, result, internal_dict):
38 check(debugger, command, context, result, internal_dict)
40 @classmethod
41 def cfoobar(cls, debugger, command, context, result, internal_dict):
42 check(debugger, command, context, result, internal_dict)
44 def ifoobar(self, debugger, command, context, result, internal_dict):
45 check(debugger, command, context, result, internal_dict)
47 def __call__(self, debugger, command, context, result, internal_dict):
48 check(debugger, command, context, result, internal_dict)
50 @staticmethod
51 def sfoobar4(debugger, command, result, internal_dict):
52 check(debugger, command, None, result, internal_dict)
54 @classmethod
55 def cfoobar4(cls, debugger, command, result, internal_dict):
56 check(debugger, command, None, result, internal_dict)
58 def ifoobar4(self, debugger, command, result, internal_dict):
59 check(debugger, command, None, result, internal_dict)
62 class FooBar4:
63 def __call__(self, debugger, command, result, internal_dict):
64 check(debugger, command, None, result, internal_dict)
67 FooBarObj = FooBar()
69 FooBar4Obj = FooBar4()