annotate clang/test/CodeGenCXX/eh-aggregate-copy-destroy.cpp @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // Check that in case of copying an array of memcpy-able objects, their
anatofuz
parents:
diff changeset
2 // destructors will be called if an exception is thrown.
anatofuz
parents:
diff changeset
3 //
anatofuz
parents:
diff changeset
4 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fexceptions -fcxx-exceptions -O0 -fno-elide-constructors -std=c++98 -emit-llvm %s -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK98 %s
anatofuz
parents:
diff changeset
5 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fexceptions -fcxx-exceptions -O0 -fno-elide-constructors -std=c++11 -emit-llvm %s -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK11 %s
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 struct ImplicitCopy {
anatofuz
parents:
diff changeset
8 int x;
anatofuz
parents:
diff changeset
9 ImplicitCopy() { x = 10; }
anatofuz
parents:
diff changeset
10 ~ImplicitCopy() { x = 20; }
anatofuz
parents:
diff changeset
11 };
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 struct ThrowCopy {
anatofuz
parents:
diff changeset
14 ThrowCopy() {}
anatofuz
parents:
diff changeset
15 ThrowCopy(const ThrowCopy &) { throw 1; }
anatofuz
parents:
diff changeset
16 };
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 struct Container {
anatofuz
parents:
diff changeset
19 ImplicitCopy b[2];
anatofuz
parents:
diff changeset
20 ThrowCopy c;
anatofuz
parents:
diff changeset
21 };
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 int main () {
anatofuz
parents:
diff changeset
24 try {
anatofuz
parents:
diff changeset
25 Container c1;
anatofuz
parents:
diff changeset
26 // CHECK_LABEL: main
anatofuz
parents:
diff changeset
27 // CHECK-NOT: call void @_ZN9ThrowCopyC1ERKS_
anatofuz
parents:
diff changeset
28 // CHECK: invoke void @_ZN9ThrowCopyC1ERKS_
anatofuz
parents:
diff changeset
29 // CHECK98: invoke void @_ZN12ImplicitCopyD1Ev
anatofuz
parents:
diff changeset
30 // CHECK11: call void @_ZN12ImplicitCopyD1Ev
anatofuz
parents:
diff changeset
31 Container c2(c1);
anatofuz
parents:
diff changeset
32 }
anatofuz
parents:
diff changeset
33 catch (...) {
anatofuz
parents:
diff changeset
34 return 1;
anatofuz
parents:
diff changeset
35 }
anatofuz
parents:
diff changeset
36
anatofuz
parents:
diff changeset
37 return 0;
anatofuz
parents:
diff changeset
38 }
anatofuz
parents:
diff changeset
39