1// RUN: %clang_cc1 -triple  powerpc64le-unknown-unknown -std=c++11 -fopenmp -fexceptions -fcxx-exceptions -O0 -emit-llvm %s -o - | FileCheck %s
2
3// Check that regions that install a terminate scope in the exception stack can
4// correctly generate complex arithmetic.
5
6// CHECK-LABEL: ffcomplex
7void ffcomplex (int a) {
8  double _Complex dc = (double)a;
9
10  // CHECK: call { double, double } @__muldc3(double %{{.+}}, double %{{.+}}, double %{{.+}}, double %{{.+}})
11  dc *= dc;
12  // CHECK: call {{.+}} @__kmpc_fork_call({{.+}} [[REGNAME1:@.*]] to void (i32*, i32*, ...)*), { double, double }* %{{.+}})
13  #pragma omp parallel
14  {
15    dc *= dc;
16  }
17  // CHECK: ret void
18}
19
20// CHECK: define internal {{.+}}[[REGNAME1]](
21// CHECK-NOT: invoke
22// CHECK: call { double, double } @__muldc3(double %{{.+}}, double %{{.+}}, double %{{.+}}, double %{{.+}})
23// CHECK-NOT: invoke
24// CHECK: ret void
25
26// Check if we are observing the function pointer attribute regardless what is
27// in the exception specification of the callees.
28void fnoexcp(void) noexcept;
29
30// CHECK-LABEL: foo
31void foo(int a, int b) {
32
33  void (*fptr)(void) noexcept = fnoexcp;
34
35  // CHECK: call {{.+}} @__kmpc_fork_call({{.+}} [[REGNAME2:@.*]] to void (i32*, i32*, ...)*), void ()** %{{.+}})
36  #pragma omp parallel
37  {
38    fptr();
39  }
40  // CHECK: ret void
41}
42
43// CHECK: define internal {{.+}}[[REGNAME2]](
44// CHECK-NOT: invoke
45// CHECK: call void %{{[0-9]+}}()
46// CHECK-NOT: invoke
47// CHECK: ret void
48