Debian Codegraph @

clang/test/PCH/msvc-vector-deleting-destructors.cpp

raw
1 // Test this without pch.
2 // RUN: %clang_cc1 -x c++ -include %S/Inputs/msvc-vector-deleting-dtors.h -emit-llvm -o - %s -triple=i386-pc-win32 | FileCheck %s --check-prefixes CHECK,CHECK32
3 // RUN: %clang_cc1 -x c++ -include %S/Inputs/msvc-vector-deleting-dtors.h -emit-llvm -o - %s -triple=x86_64-pc-win32 | FileCheck %s --check-prefixes CHECK,CHECK64
4
5 // Test with pch.
6 // RUN: %clang_cc1 -x c++ -emit-pch -o %t -triple=i386-pc-win32 %S/Inputs/msvc-vector-deleting-dtors.h
7 // RUN: %clang_cc1 -x c++ -include-pch %t -emit-llvm -triple=i386-pc-win32 -o - %s | FileCheck %s --check-prefixes CHECK,CHECK32
8 // RUN: %clang_cc1 -x c++ -emit-pch -o %t -triple=x86_64-pc-win32 %S/Inputs/msvc-vector-deleting-dtors.h
9 // RUN: %clang_cc1 -x c++ -include-pch %t -emit-llvm -triple=x86_64-pc-win32 -o - %s | FileCheck %s --check-prefixes CHECK,CHECK64
10
11 void call_in_module_function(void) {
12 in_h_tests(new Derived[2], new Derived[3]);
13 }
14
15 void out_of_module_tests(Derived *p, Derived *p1) {
16 ::delete[] p;
17
18 delete[] p1;
19 }
20
21 // CHECK32-LABEL: define weak dso_local x86_thiscallcc noundef ptr @"??_EDerived@@UAEPAXI@Z"
22 // CHECK64-LABEL: define weak dso_local noundef ptr @"??_EDerived@@UEAAPEAXI@Z"
23 // CHECK: dtor.call_class_delete_after_array_destroy:
24 // CHECK32-NEXT: call void @"??_VBase1@@SAXPAX@Z"(ptr noundef %2)
25 // CHECK64-NEXT: call void @"??_VBase1@@SAXPEAX@Z"(ptr noundef %2)
26 // CHECK: dtor.call_glob_delete_after_array_destroy:
27 // CHECK64-NEXT: %[[ARRSZ:.*]] = mul i64 16, %[[COOKIE:.*]]
28 // CHECK32-NEXT: %[[ARRSZ:.*]] = mul i32 8, %[[COOKIE:.*]]
29 // CHECK64-NEXT: %[[TOTALSZ:.*]] = add i64 %[[ARRSZ]], 8
30 // CHECK32-NEXT: %[[TOTALSZ:.*]] = add i32 %[[ARRSZ]], 4
31 // CHECK32-NEXT: call void @"??_V@YAXPAXI@Z"(ptr noundef %2, i32 noundef %[[TOTALSZ]])
32 // CHECK64-NEXT: call void @"??_V@YAXPEAX_K@Z"(ptr noundef %2, i64 noundef %[[TOTALSZ]])
33 // CHECK: dtor.call_glob_delete:
34 // CHECK32-NEXT: call void @"??3@YAXPAXI@Z"(ptr noundef %this1, i32 noundef 8)
35 // CHECK64-NEXT: call void @"??3@YAXPEAX_K@Z"(ptr noundef %this1, i64 noundef 16)
36 // CHECK: dtor.call_class_delete:
37 // CHECK32-NEXT: call void @"??3Base2@@SAXPAX@Z"(ptr noundef %this1)
38 // CHECK64-NEXT: call void @"??3Base2@@SAXPEAX@Z"(ptr noundef %this1)