forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
func.C
1341 lines (1070 loc) · 48.2 KB
/
func.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//------------------------------------------------------------------------------
// CLING - the C++ LLVM-based InterpreterG :)
//
// This file is dual-licensed: you can choose to license it under the University
// of Illinois Open Source License or the GNU Lesser General Public License. See
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %built_cling -fno-rtti 2>&1 | FileCheck %s
// Test lookupFunctionArgs()
.rawInput
#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/LookupHelper.h"
#include "cling/Utils/Output.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclTemplate.h"
#include <cstdio>
#include <string>
using namespace std;
using namespace llvm;
void dumpDecl(const char* title, const clang::Decl* D) {
printf("%s: 0x%lx\n", title, (unsigned long) D);
std::string S;
llvm::raw_string_ostream OS(S);
dyn_cast<clang::NamedDecl>(D)
->getNameForDiagnostic(OS, D->getASTContext().getPrintingPolicy(),
/*Qualified=*/true);
printf("%s name: %s\n", title, OS.str().c_str());
D->print(cling::outs());
}
.rawInput
//
// We need to fetch the global scope declaration,
// otherwise known as the translation unit decl.
//
const cling::LookupHelper& lookup = gCling->getLookupHelper();
cling::LookupHelper::DiagSetting diags = cling::LookupHelper::WithDiagnostics;
const clang::Decl* G = lookup.findScope("", diags);
printf("G: 0x%lx\n", (unsigned long) G);
//CHECK: G: 0x{{[1-9a-f][0-9a-f]*$}}
//
// Some tools for printing.
//
.rawInput 1
void G_f() { int x = 1; }
void G_a(int v) { int x = v; }
void G_b(int vi, double vd) { int x = vi; double y = vd; }
void G_c(int vi, int vj) { int x = vi; int y = vj; }
void G_c(int vi, double vd) { int x = vi; double y = vd; }
template <class T> void G_d(T v) { T x = v; }
// Note: In CINT, looking up a class template specialization causes
// instantiation, but looking up a function template specialization
// does not, so we explicitly request the instantiations we are
// going to lookup so they will be there to find.
template void G_d(int);
template void G_d(double);
namespace N {
void H_f() { int x = 1; }
void H_a(int v) { int x = v; }
void H_b(int vi, double vd) { int x = vi; double y = vd; }
void H_c(int vi, int vj) { int x = vi; int y = vj; }
void H_c(int vi, double vd) { int x = vi; double y = vd; }
template <class T> void H_d(T v) { T x = v; }
// Note: In CINT, looking up a class template specialization causes
// instantiation, but looking up a function template specialization
// does not, so we explicitly request the instantiations we are
// going to lookup so they will be there to find.
template void H_d(int);
template void H_d(double);
} // namespace N
class B {
private:
long m_B_i;
double m_B_d;
int* m_B_ip;
public:
virtual ~B() { delete m_B_ip; m_B_ip = 0; }
B() : m_B_i(0), m_B_d(0.0), m_B_ip(0) {}
B(int vi, double vd) : m_B_i(vi), m_B_d(vd), m_B_ip(0) {}
template <class T> B(T v) : m_B_i(0), m_B_d(0.0), m_B_ip(0) { m_B_i = (T) v; }
template <class T> B(T* v) : m_B_i(0), m_B_d(0.0), m_B_ip(0) { m_B_i = (long) (T*) v; m_B_d = 1.0; }
void B_f() { int x = 1; }
void B_g(int v) { int x = v; }
void B_h(int vi, double vd) { int x = vi; double y = vd; }
void B_j(int vi, int vj) { int x = vi; int y = vj; }
void B_j(int vi, double vd) { int x = vi; double y = vd; }
template <class T> void B_k(T v) { T x = v; }
void B_m(const int& v) { int y = v; }
const long &B_n() const { return m_B_i; }
long &B_n() { return m_B_i; }
const long &B_o() const { return m_B_i; }
long B_p(float) const { return 0; }
int B_p(int) { return 0; }
void* operator new(std::size_t sz) { return ::operator new(sz); }
void* operator new(std::size_t sz, void* arena) { return arena; }
void* operator new[](std::size_t sz) { return ::operator new[](sz); }
void* operator new[](std::size_t sz, void* arena) { return arena; }
void operator delete(void* vp) { ::operator delete(vp); }
void operator delete(void* vp, void* arena) {}
void operator delete[](void* vp) { ::operator delete[](vp); }
void operator delete[](void* vp, void* arena) {}
B& operator*() { return *this; }
B operator+(B b) { return b; }
};
class A : public B {
private:
int m_A_i;
double m_A_d;
public:
void A_f() { int x = 1; }
void A_g(int v) { int x = v; }
void A_h(int vi, double vd) { int x = vi; double y = vd; }
void A_j(int vi, int vj) { int x = vi; int y = vj; }
void A_j(int vi, double vd) { int x = vi; double y = vd; }
template <class T> void A_k(T v) { T x = v; }
void A_m(const int& v) { int y = v; }
void* operator new(std::size_t sz) { return ::operator new(sz); }
void* operator new(std::size_t sz, void* arena) { return arena; }
void* operator new[](std::size_t sz) { return ::operator new[](sz); }
void* operator new[](std::size_t sz, void* arena) { return arena; }
void operator delete(void* vp) { ::operator delete(vp); }
void operator delete(void* vp, void* arena) {}
void operator delete[](void* vp) { ::operator delete[](vp); }
void operator delete[](void* vp, void* arena) {}
void A_n(B& b) { b.B_f(); }
void A_n(const char *msg, int ndim = 0) { if (ndim) ++msg; }
};
B b_obj;
B* b_ptr = &b_obj;
B* b_ary = new B[3];
char b_arena[sizeof(B)*10];
char b_ary_arena[256];
.rawInput 0
//
// We need these class declarations.
//
const clang::Decl* class_A = lookup.findScope("A", diags);
printf("class_A: 0x%lx\n", (unsigned long) class_A);
//CHECK: class_A: 0x{{[1-9a-f][0-9a-f]*$}}
const clang::Decl* class_B = lookup.findScope("B", diags);
printf("class_B: 0x%lx\n", (unsigned long) class_B);
//CHECK-NEXT: class_B: 0x{{[1-9a-f][0-9a-f]*$}}
//
// We need to fetch the namespace N declaration.
//
const clang::Decl* namespace_N = lookup.findScope("N", diags);
printf("namespace_N: 0x%lx\n", (unsigned long) namespace_N);
//CHECK: namespace_N: 0x{{[1-9a-f][0-9a-f]*$}}
//
// Test finding a global function taking no args.
//
const clang::FunctionDecl* G_f_args = lookup.findFunctionArgs(G, "G_f", "", diags);
const clang::FunctionDecl* G_f_proto = lookup.findFunctionProto(G, "G_f", "", diags);
printf("G_f_args: 0x%lx\n", (unsigned long) G_f_args);
//CHECK-NEXT: G_f_args: 0x{{[1-9a-f][0-9a-f]*$}}
G_f_args->print(cling::outs());
//CHECK-NEXT: void G_f() {
//CHECK-NEXT: int x = 1;
//CHECK-NEXT: }
printf("G_f_proto: 0x%lx\n", (unsigned long) G_f_proto);
//CHECK: G_f_proto: 0x{{[1-9a-f][0-9a-f]*$}}
G_f_proto->print(cling::outs());
//CHECK-NEXT: void G_f() {
//CHECK-NEXT: int x = 1;
//CHECK-NEXT: }
//
// Test finding a global function taking a single int argument.
//
const clang::FunctionDecl* G_a_args = lookup.findFunctionArgs(G, "G_a", "0", diags);
const clang::FunctionDecl* G_a_proto = lookup.findFunctionProto(G, "G_a", "int", diags);
printf("G_a_args: 0x%lx\n", (unsigned long) G_a_args);
//CHECK: G_a_args: 0x{{[1-9a-f][0-9a-f]*$}}
G_a_args->print(cling::outs());
//CHECK-NEXT: void G_a(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
printf("G_a_proto: 0x%lx\n", (unsigned long) G_a_proto);
//CHECK: G_a_proto: 0x{{[1-9a-f][0-9a-f]*$}}
G_a_proto->print(cling::outs());
//CHECK-NEXT: void G_a(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
//
// Test finding a global function taking an int and a double argument.
//
const clang::FunctionDecl* G_b_args = lookup.findFunctionArgs(G, "G_b", "0,0.0", diags);
const clang::FunctionDecl* G_b_proto = lookup.findFunctionProto(G, "G_b", "int,double", diags);
printf("G_b_args: 0x%lx\n", (unsigned long) G_b_args);
//CHECK: G_b_args: 0x{{[1-9a-f][0-9a-f]*$}}
G_b_args->print(cling::outs());
//CHECK-NEXT: void G_b(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
printf("G_b_proto: 0x%lx\n", (unsigned long) G_b_proto);
//CHECK: G_b_proto: 0x{{[1-9a-f][0-9a-f]*$}}
G_b_proto->print(cling::outs());
//CHECK-NEXT: void G_b(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
//
// Test finding a global overloaded function.
//
const clang::FunctionDecl* G_c1_args = lookup.findFunctionArgs(G, "G_c", "0,0", diags);
const clang::FunctionDecl* G_c1_proto = lookup.findFunctionProto(G, "G_c", "int,int", diags);
printf("G_c1_args: 0x%lx\n", (unsigned long) G_c1_args);
//CHECK: G_c1_args: 0x{{[1-9a-f][0-9a-f]*$}}
G_c1_args->print(cling::outs());
//CHECK-NEXT: void G_c(int vi, int vj) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: int y = vj;
//CHECK-NEXT: }
printf("G_c1_proto: 0x%lx\n", (unsigned long) G_c1_proto);
//CHECK: G_c1_proto: 0x{{[1-9a-f][0-9a-f]*$}}
G_c1_proto->print(cling::outs());
//CHECK-NEXT: void G_c(int vi, int vj) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: int y = vj;
//CHECK-NEXT: }
const clang::FunctionDecl* G_c2_args = lookup.findFunctionArgs(G, "G_c", "0,0.0", diags);
const clang::FunctionDecl* G_c2_proto = lookup.findFunctionProto(G, "G_c", "int,double", diags);
printf("G_c2_args: 0x%lx\n", (unsigned long) G_c2_args);
//CHECK: G_c2_args: 0x{{[1-9a-f][0-9a-f]*$}}
G_c2_args->print(cling::outs());
//CHECK-NEXT: void G_c(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
printf("G_c2_proto: 0x%lx\n", (unsigned long) G_c2_proto);
//CHECK: G_c2_proto: 0x{{[1-9a-f][0-9a-f]*$}}
G_c2_proto->print(cling::outs());
//CHECK-NEXT: void G_c(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
//
// Test finding simple global template instantiations.
//
const clang::FunctionDecl* G_d1_args = lookup.findFunctionArgs(G, "G_d<int>", "0", diags);
const clang::FunctionDecl* G_d1_proto = lookup.findFunctionProto(G, "G_d<int>", "int", diags);
printf("G_d1_args: 0x%lx\n", (unsigned long) G_d1_args);
//CHECK: G_d1_args: 0x{{[1-9a-f][0-9a-f]*$}}
G_d1_args->print(cling::outs());
//CHECK-NEXT: template<> void G_d<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
printf("G_d1_proto: 0x%lx\n", (unsigned long) G_d1_proto);
//CHECK: G_d1_proto: 0x{{[1-9a-f][0-9a-f]*$}}
G_d1_proto->print(cling::outs());
//CHECK-NEXT: template<> void G_d<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
const clang::FunctionDecl* G_d2_args = lookup.findFunctionArgs(G, "G_d<double>", "0.0", diags);
const clang::FunctionDecl* G_d2_proto = lookup.findFunctionProto(G, "G_d<double>", "double", diags);
printf("G_d2_args: 0x%lx\n", (unsigned long) G_d2_args);
//CHECK: G_d2_args: 0x{{[1-9a-f][0-9a-f]*$}}
G_d2_args->print(cling::outs());
//CHECK-NEXT: template<> void G_d<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
printf("G_d2_proto: 0x%lx\n", (unsigned long) G_d2_proto);
//CHECK: G_d2_proto: 0x{{[1-9a-f][0-9a-f]*$}}
G_d2_proto->print(cling::outs());
//CHECK-NEXT: template<> void G_d<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
//
// Test finding a namespace function taking no args.
//
const clang::FunctionDecl* H_f_args = lookup.findFunctionArgs(namespace_N, "H_f", "", diags);
const clang::FunctionDecl* H_f_proto = lookup.findFunctionProto(namespace_N, "H_f", "", diags);
printf("H_f_args: 0x%lx\n", (unsigned long) H_f_args);
//CHECK: H_f_args: 0x{{[1-9a-f][0-9a-f]*$}}
H_f_args->print(cling::outs());
//CHECK-NEXT: void H_f() {
//CHECK-NEXT: int x = 1;
//CHECK-NEXT: }
printf("H_f_proto: 0x%lx\n", (unsigned long) H_f_proto);
//CHECK: H_f_proto: 0x{{[1-9a-f][0-9a-f]*$}}
H_f_proto->print(cling::outs());
//CHECK-NEXT: void H_f() {
//CHECK-NEXT: int x = 1;
//CHECK-NEXT: }
//
// Test finding a namespace function taking a single int argument.
//
const clang::FunctionDecl* H_a_args = lookup.findFunctionArgs(namespace_N, "H_a", "0", diags);
const clang::FunctionDecl* H_a_proto = lookup.findFunctionProto(namespace_N, "H_a", "int", diags);
printf("H_a_args: 0x%lx\n", (unsigned long) H_a_args);
//CHECK: H_a_args: 0x{{[1-9a-f][0-9a-f]*$}}
H_a_args->print(cling::outs());
//CHECK-NEXT: void H_a(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
printf("H_a_proto: 0x%lx\n", (unsigned long) H_a_proto);
//CHECK: H_a_proto: 0x{{[1-9a-f][0-9a-f]*$}}
H_a_proto->print(cling::outs());
//CHECK-NEXT: void H_a(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
//
// Test finding a namespace function taking an int and a double argument.
//
const clang::FunctionDecl* H_b_args = lookup.findFunctionArgs(namespace_N, "H_b", "0,0.0", diags);
const clang::FunctionDecl* H_b_proto = lookup.findFunctionProto(namespace_N, "H_b", "int,double", diags);
printf("H_b_args: 0x%lx\n", (unsigned long) H_b_args);
//CHECK: H_b_args: 0x{{[1-9a-f][0-9a-f]*$}}
H_b_args->print(cling::outs());
//CHECK-NEXT: void H_b(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
printf("H_b_proto: 0x%lx\n", (unsigned long) H_b_proto);
//CHECK: H_b_proto: 0x{{[1-9a-f][0-9a-f]*$}}
H_b_proto->print(cling::outs());
//CHECK-NEXT: void H_b(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
//
// Test finding a namespace overloaded function.
//
const clang::FunctionDecl* H_c1_args = lookup.findFunctionArgs(namespace_N, "H_c", "0,0", diags);
const clang::FunctionDecl* H_c1_proto = lookup.findFunctionProto(namespace_N, "H_c", "int,int", diags);
printf("H_c1_args: 0x%lx\n", (unsigned long) H_c1_args);
//CHECK: H_c1_args: 0x{{[1-9a-f][0-9a-f]*$}}
H_c1_args->print(cling::outs());
//CHECK-NEXT: void H_c(int vi, int vj) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: int y = vj;
//CHECK-NEXT: }
printf("H_c1_proto: 0x%lx\n", (unsigned long) H_c1_proto);
//CHECK: H_c1_proto: 0x{{[1-9a-f][0-9a-f]*$}}
H_c1_proto->print(cling::outs());
//CHECK-NEXT: void H_c(int vi, int vj) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: int y = vj;
//CHECK-NEXT: }
const clang::FunctionDecl* H_c2_args = lookup.findFunctionArgs(namespace_N, "H_c", "0,0.0", diags);
const clang::FunctionDecl* H_c2_proto = lookup.findFunctionProto(namespace_N, "H_c", "int,double", diags);
printf("H_c2_args: 0x%lx\n", (unsigned long) H_c2_args);
//CHECK: H_c2_args: 0x{{[1-9a-f][0-9a-f]*$}}
H_c2_args->print(cling::outs());
//CHECK-NEXT: void H_c(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
printf("H_c2_proto: 0x%lx\n", (unsigned long) H_c2_proto);
//CHECK: H_c2_proto: 0x{{[1-9a-f][0-9a-f]*$}}
H_c2_proto->print(cling::outs());
//CHECK-NEXT: void H_c(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
//
// Test finding simple namespace template instantiations.
//
const clang::FunctionDecl* H_d1_args = lookup.findFunctionArgs(namespace_N, "H_d<int>", "0", diags);
const clang::FunctionDecl* H_d1_proto = lookup.findFunctionProto(namespace_N, "H_d<int>", "int", diags);
printf("H_d1_args: 0x%lx\n", (unsigned long) H_d1_args);
//CHECK: H_d1_args: 0x{{[1-9a-f][0-9a-f]*$}}
H_d1_args->print(cling::outs());
//CHECK-NEXT: template<> void H_d<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
printf("H_d1_proto: 0x%lx\n", (unsigned long) H_d1_proto);
//CHECK: H_d1_proto: 0x{{[1-9a-f][0-9a-f]*$}}
H_d1_proto->print(cling::outs());
//CHECK-NEXT: template<> void H_d<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
const clang::FunctionDecl* H_d2_args = lookup.findFunctionArgs(namespace_N, "H_d<double>", "0.0", diags);
const clang::FunctionDecl* H_d2_proto = lookup.findFunctionProto(namespace_N, "H_d<double>", "double", diags);
printf("H_d2_args: 0x%lx\n", (unsigned long) H_d2_args);
//CHECK: H_d2_args: 0x{{[1-9a-f][0-9a-f]*$}}
H_d2_args->print(cling::outs());
//CHECK-NEXT: template<> void H_d<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
printf("H_d2_proto: 0x%lx\n", (unsigned long) H_d2_proto);
//CHECK: H_d2_proto: 0x{{[1-9a-f][0-9a-f]*$}}
H_d2_proto->print(cling::outs());
//CHECK-NEXT: template<> void H_d<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
//
// Test finding a member function taking no args.
//
const clang::FunctionDecl* func_A_f_args = lookup.findFunctionArgs(class_A, "A_f", "", diags);
const clang::FunctionDecl* func_A_f_proto = lookup.findFunctionProto(class_A, "A_f", "", diags);
printf("func_A_f_args: 0x%lx\n", (unsigned long) func_A_f_args);
//CHECK: func_A_f_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_f_args->print(cling::outs());
//CHECK-NEXT: void A_f() {
//CHECK-NEXT: int x = 1;
//CHECK-NEXT: }
printf("func_A_f_proto: 0x%lx\n", (unsigned long) func_A_f_proto);
//CHECK: func_A_f_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_f_proto->print(cling::outs());
//CHECK-NEXT: void A_f() {
//CHECK-NEXT: int x = 1;
//CHECK-NEXT: }
//
// Test finding a member function taking an int arg.
//
const clang::FunctionDecl* func_A_g_args = lookup.findFunctionArgs(class_A, "A_g", "0", diags);
const clang::FunctionDecl* func_A_g_proto = lookup.findFunctionProto(class_A, "A_g", "int", diags);
printf("func_A_g_args: 0x%lx\n", (unsigned long) func_A_g_args);
//CHECK: func_A_g_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_g_args->print(cling::outs());
//CHECK-NEXT: void A_g(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
printf("func_A_g_proto: 0x%lx\n", (unsigned long) func_A_g_proto);
//CHECK: func_A_g_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_g_proto->print(cling::outs());
//CHECK-NEXT: void A_g(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
//
// Test finding a member function taking an int and a double argument.
//
const clang::FunctionDecl* func_A_h_args = lookup.findFunctionArgs(class_A, "A_h", "0,0.0", diags);
const clang::FunctionDecl* func_A_h_proto = lookup.findFunctionProto(class_A, "A_h", "int,double", diags);
printf("func_A_h_args: 0x%lx\n", (unsigned long) func_A_h_args);
//CHECK: func_A_h_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_h_args->print(cling::outs());
//CHECK-NEXT: void A_h(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
printf("func_A_h_proto: 0x%lx\n", (unsigned long) func_A_h_proto);
//CHECK: func_A_h_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_h_proto->print(cling::outs());
//CHECK-NEXT: void A_h(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
//
// Test finding an overloaded member function.
//
const clang::FunctionDecl* func_A_j1_args = lookup.findFunctionArgs(class_A, "A_j", "0,0", diags);
const clang::FunctionDecl* func_A_j1_proto = lookup.findFunctionProto(class_A, "A_j", "int,int", diags);
printf("func_A_j1_args: 0x%lx\n", (unsigned long) func_A_j1_args);
//CHECK: func_A_j1_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_j1_args->print(cling::outs());
//CHECK-NEXT: void A_j(int vi, int vj) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: int y = vj;
//CHECK-NEXT: }
printf("func_A_j1_proto: 0x%lx\n", (unsigned long) func_A_j1_proto);
//CHECK: func_A_j1_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_j1_proto->print(cling::outs());
//CHECK-NEXT: void A_j(int vi, int vj) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: int y = vj;
//CHECK-NEXT: }
const clang::FunctionDecl* func_A_j2_args = lookup.findFunctionArgs(class_A, "A_j", "0,0.0", diags);
const clang::FunctionDecl* func_A_j2_proto = lookup.findFunctionProto(class_A, "A_j", "int,double", diags);
printf("func_A_j2_args: 0x%lx\n", (unsigned long) func_A_j2_args);
//CHECK: func_A_j2_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_j2_args->print(cling::outs());
//CHECK-NEXT: void A_j(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
printf("func_A_j2_proto: 0x%lx\n", (unsigned long) func_A_j2_proto);
//CHECK: func_A_j2_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_j2_proto->print(cling::outs());
//CHECK-NEXT: void A_j(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
//
// Test finding simple member function template instantiations.
//
const clang::FunctionDecl* func_A_k1_args = lookup.findFunctionArgs(class_A, "A_k<int>", "0", diags);
const clang::FunctionDecl* func_A_k1_proto = lookup.findFunctionProto(class_A, "A_k<int>", "int", diags);
printf("func_A_k1_args: 0x%lx\n", (unsigned long) func_A_k1_args);
//CHECK: func_A_k1_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_k1_args->print(cling::outs());
//CHECK-NEXT: template<> void A_k<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
printf("func_A_k1_proto: 0x%lx\n", (unsigned long) func_A_k1_proto);
//CHECK: func_A_k1_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_k1_proto->print(cling::outs());
//CHECK-NEXT: template<> void A_k<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
const clang::FunctionDecl* func_A_k2_args = lookup.findFunctionArgs(class_A, "A_k<double>", "0.0", diags);
const clang::FunctionDecl* func_A_k2_proto = lookup.findFunctionProto(class_A, "A_k<double>", "double", diags);
printf("func_A_k2_args: 0x%lx\n", (unsigned long) func_A_k2_args);
//CHECK: func_A_k2_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_k2_args->print(cling::outs());
//CHECK-NEXT: template<> void A_k<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
printf("func_A_k2_proto: 0x%lx\n", (unsigned long) func_A_k2_proto);
//CHECK: func_A_k2_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_k2_proto->print(cling::outs());
//CHECK-NEXT: template<> void A_k<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
//
// Test finding a member function taking a const int reference arg.
//
const clang::FunctionDecl* func_A_m_args = lookup.findFunctionArgs(class_A, "A_m", "0", diags);
const clang::FunctionDecl* func_A_m_proto = lookup.findFunctionProto(class_A, "A_m", "const int&", diags);
printf("func_A_m_args: 0x%lx\n", (unsigned long) func_A_m_args);
//CHECK: func_A_m_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_m_args->print(cling::outs());
//CHECK-NEXT: void A_m(const int &v) {
//CHECK-NEXT: int y = v;
//CHECK-NEXT: }
printf("func_A_m_proto: 0x%lx\n", (unsigned long) func_A_m_proto);
//CHECK: func_A_m_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_m_proto->print(cling::outs());
//CHECK-NEXT: void A_m(const int &v) {
//CHECK-NEXT: int y = v;
//CHECK-NEXT: }
//
// Test finding a member function taking an obj reference arg.
//
const clang::FunctionDecl* func_A_n_args = lookup.findFunctionArgs(class_A, "A_n", "*(new B())", diags);
const clang::FunctionDecl* func_A_n_proto = lookup.findFunctionProto(class_A, "A_n", "B&", diags);
printf("func_A_n_args: 0x%lx\n", (unsigned long) func_A_n_args);
//CHECK: func_A_n_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_n_args->print(cling::outs());
//CHECK-NEXT: void A_n(B &b) {
//CHECK-NEXT: b.B_f();
//CHECK-NEXT: }
printf("func_A_n_proto: 0x%lx\n", (unsigned long) func_A_n_proto);
//CHECK: func_A_n_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_n_proto->print(cling::outs());
//CHECK-NEXT: void A_n(B &b) {
//CHECK-NEXT: b.B_f();
//CHECK-NEXT: }
//
// Test finding a member function taking with a default argument.
//
const clang::FunctionDecl* func_A_n2_args = lookup.findFunctionArgs(class_A, "A_n", "\"\"", diags);
const clang::FunctionDecl* func_A_n2_proto = lookup.findFunctionProto(class_A, "A_n", "const char *", diags);
printf("func_A_n2_args: 0x%lx\n", (unsigned long) func_A_n2_args);
//CHECK: func_A_n2_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_n2_args->print(cling::outs());
//CHECK-NEXT: void A_n(const char *msg, int ndim = 0) {
//CHECK-NEXT: if (ndim)
//CHECK-NEXT: ++msg;
//CHECK-NEXT: }
printf("func_A_n2_proto: 0x%lx\n", (unsigned long) func_A_n2_proto);
//CHECK: func_A_n2_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_n2_proto->print(cling::outs());
//CHECK-NEXT: void A_n(const char *msg, int ndim = 0) {
//CHECK-NEXT: if (ndim)
//CHECK-NEXT: ++msg;
//CHECK-NEXT: }
//
// Test finding a member function taking no args in a base class.
//
const clang::FunctionDecl* func_B_F_args = lookup.findFunctionArgs(class_A, "B_f", "", diags);
const clang::FunctionDecl* func_B_F_proto = lookup.findFunctionProto(class_A, "B_f", "", diags);
printf("func_B_F_args: 0x%lx\n", (unsigned long) func_B_F_args);
//CHECK: func_B_F_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_F_args->print(cling::outs());
//CHECK-NEXT: void B_f() {
//CHECK-NEXT: int x = 1;
//CHECK-NEXT: }
printf("func_B_F_proto: 0x%lx\n", (unsigned long) func_B_F_proto);
//CHECK: func_B_F_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_F_proto->print(cling::outs());
//CHECK-NEXT: void B_f() {
//CHECK-NEXT: int x = 1;
//CHECK-NEXT: }
//
// Test finding a member function taking an int arg in a base class.
//
const clang::FunctionDecl* func_B_G_args = lookup.findFunctionArgs(class_A, "B_g", "0", diags);
const clang::FunctionDecl* func_B_G_proto = lookup.findFunctionProto(class_A, "B_g", "int", diags);
printf("func_B_G_args: 0x%lx\n", (unsigned long) func_B_G_args);
//CHECK: func_B_G_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_G_args->print(cling::outs());
//CHECK-NEXT: void B_g(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
printf("func_B_G_proto: 0x%lx\n", (unsigned long) func_B_G_proto);
//CHECK: func_B_G_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_G_proto->print(cling::outs());
//CHECK-NEXT: void B_g(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
//
// Test finding a member function taking an int and a double argument
// in a base class.
//
const clang::FunctionDecl* func_B_h_args = lookup.findFunctionArgs(class_A, "B_h", "0,0.0", diags);
const clang::FunctionDecl* func_B_h_proto = lookup.findFunctionProto(class_A, "B_h", "int,double", diags);
printf("func_B_h_args: 0x%lx\n", (unsigned long) func_B_h_args);
//CHECK: func_B_h_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_h_args->print(cling::outs());
//CHECK-NEXT: void B_h(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
printf("func_B_h_proto: 0x%lx\n", (unsigned long) func_B_h_proto);
//CHECK: func_B_h_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_h_proto->print(cling::outs());
//CHECK-NEXT: void B_h(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
//
// Test finding a member function taking an int and a double argument
// in a base class using the preparse types.
//
llvm::SmallVector<clang::QualType, 4> types;
types.push_back(lookup.findType("int", diags));
types.push_back(lookup.findType("float", diags));
const clang::FunctionDecl* func_B_h_proto_type = lookup.findFunctionProto(class_A, "B_h", types, diags);
types.pop_back();
types.push_back(lookup.findType("double", diags));
const clang::FunctionDecl* func_B_h_match_proto_type = lookup.matchFunctionProto(class_A, "B_h", types, diags, false);
printf("func_B_h_proto_type: 0x%lx\n", (unsigned long) func_B_h_proto_type);
//CHECK: func_B_h_proto_type: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_h_proto_type->print(cling::outs());
//CHECK-NEXT: void B_h(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
printf("func_B_h_match_proto_type: 0x%lx\n", (unsigned long) func_B_h_match_proto_type);
//CHECK: func_B_h_match_proto_type: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_h_match_proto_type->print(cling::outs());
//CHECK-NEXT: void B_h(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
//
// Test finding an overloaded member function in a base class.
//
const clang::FunctionDecl* func_B_j1_args = lookup.findFunctionArgs(class_A, "B_j", "0,0", diags);
const clang::FunctionDecl* func_B_j1_proto = lookup.findFunctionProto(class_A, "B_j", "int,int", diags);
printf("func_B_j1_args: 0x%lx\n", (unsigned long) func_B_j1_args);
//CHECK: func_B_j1_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_j1_args->print(cling::outs());
//CHECK-NEXT: void B_j(int vi, int vj) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: int y = vj;
//CHECK-NEXT: }
printf("func_B_j1_proto: 0x%lx\n", (unsigned long) func_B_j1_proto);
//CHECK: func_B_j1_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_j1_proto->print(cling::outs());
//CHECK-NEXT: void B_j(int vi, int vj) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: int y = vj;
//CHECK-NEXT: }
const clang::FunctionDecl* func_B_j2_args = lookup.findFunctionArgs(class_A, "B_j", "0,0.0", diags);
const clang::FunctionDecl* func_B_j2_proto = lookup.findFunctionProto(class_A, "B_j", "int,double", diags);
printf("func_B_j2_args: 0x%lx\n", (unsigned long) func_B_j2_args);
//CHECK: func_B_j2_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_j2_args->print(cling::outs());
//CHECK-NEXT: void B_j(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
printf("func_B_j2_proto: 0x%lx\n", (unsigned long) func_B_j2_proto);
//CHECK: func_B_j2_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_j2_proto->print(cling::outs());
//CHECK-NEXT: void B_j(int vi, double vd) {
//CHECK-NEXT: int x = vi;
//CHECK-NEXT: double y = vd;
//CHECK-NEXT: }
//
// Test finding simple member function template instantiations in a base class.
//
const clang::FunctionDecl* func_B_k1_args = lookup.findFunctionArgs(class_A, "B_k<int>", "0", diags);
const clang::FunctionDecl* func_B_k1_proto = lookup.findFunctionProto(class_A, "B_k<int>", "int", diags);
printf("func_B_k1_args: 0x%lx\n", (unsigned long) func_B_k1_args);
//CHECK: func_B_k1_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_k1_args->print(cling::outs());
//CHECK-NEXT: template<> void B_k<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
printf("func_B_k1_proto: 0x%lx\n", (unsigned long) func_B_k1_proto);
//CHECK: func_B_k1_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_k1_proto->print(cling::outs());
//CHECK-NEXT: template<> void B_k<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
const clang::FunctionDecl* func_B_k2_args = lookup.findFunctionArgs(class_A, "B_k<double>", "0.0", diags);
const clang::FunctionDecl* func_B_k2_proto = lookup.findFunctionProto(class_A, "B_k<double>", "double", diags);
printf("func_B_k2_args: 0x%lx\n", (unsigned long) func_B_k2_args);
//CHECK: func_B_k2_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_k2_args->print(cling::outs());
//CHECK-NEXT: template<> void B_k<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
printf("func_B_k2_proto: 0x%lx\n", (unsigned long) func_B_k2_proto);
//CHECK: func_B_k2_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_k2_proto->print(cling::outs());
//CHECK-NEXT: template<> void B_k<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
//
// Test finding a member function taking a const int reference arg in a base class.
//
const clang::FunctionDecl* func_B_m_args = lookup.findFunctionArgs(class_A, "B_m", "0", diags);
const clang::FunctionDecl* func_B_m_proto = lookup.findFunctionProto(class_A, "B_m", "const int&", diags);
printf("func_B_m_args: 0x%lx\n", (unsigned long) func_B_m_args);
//CHECK: func_B_m_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_m_args->print(cling::outs());
//CHECK-NEXT: void B_m(const int &v) {
//CHECK-NEXT: int y = v;
//CHECK-NEXT: }
printf("func_B_m_proto: 0x%lx\n", (unsigned long) func_B_m_proto);
//CHECK: func_B_m_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_m_proto->print(cling::outs());
//CHECK-NEXT: void B_m(const int &v) {
//CHECK-NEXT: int y = v;
//CHECK-NEXT: }
//
// Test finding a member function that are const or not
//
const clang::FunctionDecl* func_B_n_args = lookup.findFunctionArgs(class_A, "B_n", "", diags, false);
const clang::FunctionDecl* func_B_n_proto = lookup.findFunctionProto(class_A, "B_n", "", diags, false);
printf("func_B_n_args: 0x%lx\n", (unsigned long) func_B_n_args);
//CHECK: func_B_n_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_n_args->print(cling::outs());
//CHECK-NEXT: long &B_n() {
//CHECK-NEXT: return this->m_B_i;
//CHECK-NEXT: }
printf("func_B_n_proto: 0x%lx\n", (unsigned long) func_B_n_proto);
//CHECK: func_B_n_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_n_proto->print(cling::outs());
//CHECK-NEXT: long &B_n() {
//CHECK-NEXT: return this->m_B_i;
//CHECK-NEXT: }
const clang::FunctionDecl* func_const_B_n_args = lookup.findFunctionArgs(class_A, "B_n", "", diags, true);
const clang::FunctionDecl* func_const_B_n_proto = lookup.findFunctionProto(class_A, "B_n", "", diags, true);
printf("func_const_B_n_args: 0x%lx\n", (unsigned long) func_const_B_n_args);
//CHECK: func_const_B_n_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_const_B_n_args->print(cling::outs());
//CHECK-NEXT: const long &B_n() const {
//CHECK-NEXT: return this->m_B_i;
//CHECK-NEXT: }
printf("func_const_B_n_proto: 0x%lx\n", (unsigned long) func_const_B_n_proto);
//CHECK: func_const_B_n_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_const_B_n_proto->print(cling::outs());
//CHECK-NEXT: const long &B_n() const {
//CHECK-NEXT: return this->m_B_i;
//CHECK-NEXT: }
const clang::FunctionDecl* func_const_B_m_proto = lookup.findFunctionProto(class_A, "B_m", "const int&", diags, true);
const clang::FunctionDecl* func_const_B_o_proto = lookup.findFunctionProto(class_A, "B_o", "", diags, true);
printf("func_const_B_m_proto: 0x%lx\n", (unsigned long) func_const_B_m_proto);
//CHECK: func_const_B_m_proto: 0x0
printf("func_const_B_o_proto: 0x%lx\n", (unsigned long) func_const_B_o_proto);
//CHECK: func_const_B_o_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_const_B_o_proto->print(cling::outs());
//CHECK-NEXT: const long &B_o() const {
//CHECK-NEXT: return this->m_B_i;
//CHECK-NEXT: }
// Test exact matches
const clang::FunctionDecl* func_const_B_p_proto = lookup.findFunctionProto(class_A, "B_p", "double", diags, true);
printf("func_const_B_p_proto 1: 0x%lx\n", (unsigned long) func_const_B_p_proto);
//CHECK: func_const_B_p_proto 1: 0x{{[1-9a-f][0-9a-f]*$}}
func_const_B_p_proto->print(cling::outs());
//CHECK-NEXT: long B_p(float) const {
//CHECK-NEXT: return 0;
//CHECK-NEXT: }
func_const_B_p_proto = lookup.matchFunctionProto(class_A, "B_p", "double", diags, true);
printf("func_const_B_p_proto 2: 0x%lx\n", (unsigned long) func_const_B_p_proto);
//CHECK: func_const_B_p_proto 2: 0x0
func_const_B_p_proto = lookup.matchFunctionProto(class_A, "B_p", "float", diags, true);
printf("func_const_B_p_proto 3: 0x%lx\n", (unsigned long) func_const_B_p_proto);
//CHECK: func_const_B_p_proto 3: 0x{{[1-9a-f][0-9a-f]*$}}
func_const_B_p_proto->print(cling::outs());
//CHECK-NEXT: long B_p(float) const {
//CHECK-NEXT: return 0;
//CHECK-NEXT: }
func_const_B_p_proto = lookup.matchFunctionProto(class_A, "B_p", "float", diags, false);
printf("func_const_B_p_proto 4: 0x%lx\n", (unsigned long) func_const_B_p_proto);
//CHECK: func_const_B_p_proto 4: 0x0
func_const_B_p_proto = lookup.matchFunctionProto(class_A, "B_p", "int", diags, false);
printf("func_const_B_p_proto 5: 0x%lx\n", (unsigned long) func_const_B_p_proto);
//CHECK: func_const_B_p_proto 5: 0x{{[1-9a-f][0-9a-f]*$}}
func_const_B_p_proto->print(cling::outs());
//CHECK-NEXT: int B_p(int) {
//CHECK-NEXT: return 0;
//CHECK-NEXT: }
func_const_B_p_proto = lookup.matchFunctionProto(class_A, "B_p", "int", diags, true);
printf("func_const_B_p_proto 6: 0x%lx\n", (unsigned long) func_const_B_p_proto);
//CHECK: func_const_B_p_proto 6: 0x0
func_const_B_p_proto = lookup.matchFunctionProto(class_A, "B_p", "short", diags, false);
printf("func_const_B_p_proto 6: 0x%lx\n", (unsigned long) func_const_B_p_proto);
//CHECK: func_const_B_p_proto 6: 0x0
func_const_B_p_proto = lookup.matchFunctionProto(class_A, "B_p", "long", diags, false);
printf("func_const_B_p_proto 6: 0x%lx\n", (unsigned long) func_const_B_p_proto);
//CHECK: func_const_B_p_proto 6: 0x0
//
// Test finding constructors.
//
//