[flang] Fix length handling in character kind implicit conversion (#74586)
[llvm-project.git] / lldb / test / Shell / SymbolFile / NativePDB / find-functions.cpp
blob5ebef61bdbfef2d9fc5bcec126c758a11d7ca143
1 // clang-format off
2 // REQUIRES: lld, x86
4 // RUN: %clang_cl --target=x86_64-windows-msvc -Od -Z7 -c /GR- /Fo%t.obj -- %s
5 // RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj -out:%t.exe -pdb:%t.pdb
7 // RUN: lldb-test symbols --find=function --name=main --function-flags=full %t.exe \
8 // RUN: | FileCheck %s --check-prefix=FIND-MAIN
10 // RUN: lldb-test symbols --find=function --name=static_fn --function-flags=full %t.exe \
11 // RUN: | FileCheck %s --check-prefix=FIND-STATIC
13 // RUN: lldb-test symbols --find=function --name=varargs_fn --function-flags=full %t.exe \
14 // RUN: | FileCheck %s --check-prefix=FIND-VAR
16 // RUN: lldb-test symbols --find=function --name=Struct::simple_method --function-flags=full %t.exe \
17 // RUN: | FileCheck %s --check-prefix=FIND-SIMPLE
19 // RUN: lldb-test symbols --find=function --name=Struct::virtual_method --function-flags=full %t.exe \
20 // RUN: | FileCheck %s --check-prefix=FIND-VIRTUAL
22 // RUN: lldb-test symbols --find=function --name=Struct::static_method --function-flags=full %t.exe \
23 // RUN: | FileCheck %s --check-prefix=FIND-STATIC-METHOD
25 // RUN: lldb-test symbols --find=function --name=Struct::overloaded_method --function-flags=full %t.exe \
26 // RUN: | FileCheck %s --check-prefix=FIND-OVERLOAD
28 struct Struct {
29 int simple_method() {
30 return 1;
33 virtual int virtual_method() {
34 return 2;
37 static int static_method() {
38 return 3;
41 int overloaded_method() {
42 return 4 + overloaded_method('a') + overloaded_method('a', 1);
44 protected:
45 virtual int overloaded_method(char c) {
46 return 5;
48 private:
49 static int overloaded_method(char c, int i, ...) {
50 return 6;
54 Struct s;
56 static int static_fn() {
57 return 42;
60 int varargs_fn(int x, int y, ...) {
61 return x + y;
64 int main(int argc, char **argv) {
65 return static_fn() + varargs_fn(argc, argc) + s.simple_method() +
66 Struct::static_method() + s.virtual_method() + s.overloaded_method();
69 // FIND-MAIN: Function: id = {{.*}}, name = "main"
70 // FIND-MAIN-NEXT: FuncType: id = {{.*}}, compiler_type = "int (int, char **)"
72 // FIND-STATIC: Function: id = {{.*}}, name = "{{.*}}static_fn{{.*}}"
73 // FIND-STATIC-NEXT: FuncType: id = {{.*}}, compiler_type = "int (void)"
75 // FIND-VAR: Function: id = {{.*}}, name = "{{.*}}varargs_fn{{.*}}"
76 // FIND-VAR-NEXT: FuncType: id = {{.*}}, compiler_type = "int (int, int, ...)"
78 // FIND-SIMPLE: Function: id = {{.*}}, name = "{{.*}}Struct::simple_method{{.*}}"
79 // FIND-SIMPLE-NEXT: FuncType: id = {{.*}}, compiler_type = "int (void)"
81 // FIND-VIRTUAL: Function: id = {{.*}}, name = "{{.*}}Struct::virtual_method{{.*}}"
82 // FIND-VIRTUAL-NEXT: FuncType: id = {{.*}}, compiler_type = "int (void)"
84 // FIND-STATIC-METHOD: Function: id = {{.*}}, name = "{{.*}}Struct::static_method{{.*}}"
85 // FIND-STATIC-METHOD-NEXT: FuncType: id = {{.*}}, compiler_type = "int (void)"
87 // FIND-OVERLOAD: Function: id = {{.*}}, name = "{{.*}}Struct::overloaded_method{{.*}}"
88 // FIND-OVERLOAD: FuncType: id = {{.*}}, compiler_type = "int (void)"
89 // FIND-OVERLOAD: FuncType: id = {{.*}}, compiler_type = "int (char)"
90 // FIND-OVERLOAD: FuncType: id = {{.*}}, compiler_type = "int (char, int, ...)"