1 // RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++11 -w %s > %t 2>&1
2 // RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX11,CXX11-ELIDE %s
3 // RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++17 -w %s > %t 2>&1
4 // RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX17 %s
5 // RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++11 -w -analyzer-config elide-constructors=false %s > %t 2>&1
6 // RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX11,CXX11-NOELIDE %s
7 // RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++17 -w -analyzer-config elide-constructors=false %s > %t 2>&1
8 // RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX17 %s
21 // CHECK: void passArgumentIntoMessage(E *e)
23 // CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, LValueToRValue, E *)
24 // CXX11-ELIDE-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.6], [B1.7], D)
25 // CXX11-NOELIDE-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.6], D)
26 // CXX11-NEXT: 4: [B1.3] (BindTemporary)
27 // CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const D)
28 // CXX11-NEXT: 6: [B1.5]
29 // CXX11-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.8], [B1.9]+0, D)
30 // CXX11-NEXT: 8: [B1.7] (BindTemporary)
31 // Double brackets trigger FileCheck variables, escape.
32 // CXX11-NEXT: 9: {{\[}}[B1.2] foo:[B1.8]]
33 // CXX11-NEXT: 10: ~D() (Temporary object destructor)
34 // CXX11-NEXT: 11: ~D() (Temporary object destructor)
35 // CXX17-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.5]+0, D)
36 // CXX17-NEXT: 4: [B1.3] (BindTemporary)
37 // Double brackets trigger FileCheck variables, escape.
38 // CXX17-NEXT: 5: {{\[}}[B1.2] foo:[B1.4]]
39 // CXX17-NEXT: 6: ~D() (Temporary object destructor)
40 void passArgumentIntoMessage(E *e) {
44 // CHECK: void returnObjectFromMessage(E *e)
47 // CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, LValueToRValue, E *)
48 // Double brackets trigger FileCheck variables, escape.
49 // CXX11-ELIDE-NEXT: 3: {{\[}}[B1.2] bar] (CXXRecordTypedCall, [B1.4], [B1.6], [B1.7])
50 // CXX11-NOELIDE-NEXT: 3: {{\[}}[B1.2] bar] (CXXRecordTypedCall, [B1.4], [B1.6])
51 // CXX11-NEXT: 4: [B1.3] (BindTemporary)
52 // CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const D)
53 // CXX11-NEXT: 6: [B1.5]
54 // CXX11-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.8], D)
55 // CXX11-NEXT: 8: D d = [e bar];
56 // CXX11-NEXT: 9: ~D() (Temporary object destructor)
57 // CXX11-NEXT: 10: [B1.8].~D() (Implicit destructor)
58 // Double brackets trigger FileCheck variables, escape.
59 // CXX17-NEXT: 3: {{\[}}[B1.2] bar] (CXXRecordTypedCall, [B1.5], [B1.4])
60 // CXX17-NEXT: 4: [B1.3] (BindTemporary)
61 // CXX17-NEXT: 5: D d = [e bar];
62 // CXX17-NEXT: 6: [B1.5].~D() (Implicit destructor)
63 void returnObjectFromMessage(E *e) {