brintos

brintos / llvm-project-archived public Read only

0
0
Text · 752 B · 79dc1fe Raw
25 lines · plain
1// RUN: %clang_cc1 -fopenmp -fsyntax-only -verify %s2// RUN: %clang_cc1 -fopenmp -fexceptions -fsyntax-only -verify %s3 4#include "Inputs/cuda.h"5 6__device__ void foo(int) {} // expected-note {{candidate function not viable: call to __device__ function from __host__ function}}7// expected-note@-1 {{'foo' declared here}}8 9int main() {10  #pragma omp parallel11  for (int i = 0; i < 100; i++) {12    foo(1); // expected-error {{no matching function for call to 'foo'}}13    new int;14  }15 16  auto Lambda = []() {17    #pragma omp parallel18    for (int i = 0; i < 100; i++) {19      foo(1); // expected-error {{reference to __device__ function 'foo' in __host__ __device__ function}}20      new int;21    }22  };23  Lambda(); // expected-note {{called by 'main'}}24}25