brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 774e805 Raw
48 lines · cpp
1// RUN: %clang_cc1 -triple  powerpc64le-unknown-unknown -std=c++11 -fopenmp -fexceptions -fcxx-exceptions -O0 -emit-llvm %s -o - | FileCheck %s2 3// Check that regions that install a terminate scope in the exception stack can4// correctly generate complex arithmetic.5 6// CHECK-LABEL: ffcomplex7void ffcomplex (int a) {8  double _Complex dc = (double)a;9 10  // CHECK: call noundef { double, double } @__muldc3(double noundef %{{.+}}, double noundef %{{.+}}, double noundef %{{.+}}, double noundef %{{.+}})11  dc *= dc;12  // CHECK: call {{.+}} @__kmpc_fork_call({{.+}} [[REGNAME1:@.*]], ptr %{{.+}})13  #pragma omp parallel14  {15    dc *= dc;16  }17  // CHECK: ret void18}19 20// CHECK: define internal {{.+}}[[REGNAME1]](21// CHECK-NOT: invoke22// CHECK: call noundef { double, double } @__muldc3(double noundef %{{.+}}, double noundef %{{.+}}, double noundef %{{.+}}, double noundef %{{.+}})23// CHECK-NOT: invoke24// CHECK: ret void25 26// Check if we are observing the function pointer attribute regardless what is27// in the exception specification of the callees.28void fnoexcp(void) noexcept;29 30// CHECK-LABEL: foo31void foo(int a, int b) {32 33  void (*fptr)(void) noexcept = fnoexcp;34 35  // CHECK: call {{.+}} @__kmpc_fork_call({{.+}} [[REGNAME2:@.*]], ptr %{{.+}})36  #pragma omp parallel37  {38    fptr();39  }40  // CHECK: ret void41}42 43// CHECK: define internal {{.+}}[[REGNAME2]](44// CHECK-NOT: invoke45// CHECK: call void %{{[0-9]+}}()46// CHECK-NOT: invoke47// CHECK: ret void48