brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · cbad7a1 Raw
44 lines · plain
1// RUN: %clang_cc1 -std=c++11 -triple nvptx64-nvidia-cuda -fsyntax-only \2// RUN:            -fcuda-is-device -verify -verify-ignore-unexpected=note %s3// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu -fsyntax-only \4// RUN:            -verify -verify-ignore-unexpected=note %s5 6#include "Inputs/cuda.h"7 8struct In { In() = default; };9struct InD { __device__ InD() = default; };10struct InH { __host__ InH() = default; };11struct InHD { __host__ __device__ InHD() = default; };12 13struct Out { Out(); };14struct OutD { __device__ OutD(); };15struct OutH { __host__ OutH(); };16struct OutHD { __host__ __device__ OutHD(); };17 18Out::Out() = default;19__device__ OutD::OutD() = default;20__host__ OutH::OutH() = default;21__host__ __device__ OutHD::OutHD() = default;22 23__device__ void fd() {24  In in;25  InD ind;26  InH inh; // expected-error{{no matching constructor for initialization of 'InH'}}27  InHD inhd;28  Out out; // expected-error{{no matching constructor for initialization of 'Out'}}29  OutD outd;30  OutH outh; // expected-error{{no matching constructor for initialization of 'OutH'}}31  OutHD outhd;32}33 34__host__ void fh() {35  In in;36  InD ind; // expected-error{{no matching constructor for initialization of 'InD'}}37  InH inh;38  InHD inhd;39  Out out;40  OutD outd; // expected-error{{no matching constructor for initialization of 'OutD'}}41  OutH outh;42  OutHD outhd;43}44