summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/new-array-init-exceptions.cpp
blob: 5d9cc9fa636d46cf7660d04221366b2f0bd5eed5 (about) (plain)
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
// RUN: %clang_cc1 -std=c++11 -triple i386-unknown-unknown -fexceptions -fcxx-exceptions %s -emit-llvm -o - | FileCheck %s
// REQUIRES: asserts

struct Throws {
  Throws(int);
  Throws();
  ~Throws();
};

// CHECK: define void @_Z7cleanupi
void cleanup(int n) {
  // CHECK: invoke void @_ZN6ThrowsC1Ei
  // CHECK-NEXT: to label %{{[^ ]+}} unwind label %[[LPAD:[^ ]+]]
  // CHECK: invoke void @_ZN6ThrowsC1Ei
  // CHECK-NEXT: to label %{{[^ ]+}} unwind label %[[LPAD]]
  // CHECK: invoke void @_ZN6ThrowsC1Ei
  // CHECK-NEXT: to label %{{[^ ]+}} unwind label %[[LPAD]]
  // CHECK: invoke void @_ZN6ThrowsC1Ev
  // CHECK-NEXT: to label %{{[^ ]+}} unwind label %[[LPAD]]
  new Throws[n] { 1, 2, 3 };
  // CHECK: [[LPAD]]:
  // CHECK-NEXT: landingpad
  // CHECK: call void @_ZN6ThrowsD1Ev
  // CHECK: call void @_ZdaPv
}


// CHECK: define void @_Z7cleanupv
void cleanup() {
  // CHECK: invoke void @_ZN6ThrowsC1Ei
  // CHECK-NEXT: to label %{{[^ ]+}} unwind label %[[LPAD2:[^ ]+]]
  // CHECK: invoke void @_ZN6ThrowsC1Ei
  // CHECK-NEXT: to label %{{[^ ]+}} unwind label %[[LPAD2]]
  // CHECK: invoke void @_ZN6ThrowsC1Ei
  // CHECK-NEXT: to label %{{[^ ]+}} unwind label %[[LPAD2]]
  new Throws[3] { 1, 2, 3 };
  // CHECK: [[LPAD2]]:
  // CHECK-NEXT: landingpad
  // CHECK: call void @_ZN6ThrowsD1Ev
  // CHECK: call void @_ZdaPv
}