31 lines · plain
1// RUN: %clang_cc1 -std=c++11 -triple i386-windows-msvc \2// RUN: -aux-triple nvptx-nvidia-cuda -fsyntax-only -verify %s3 4// RUN: %clang_cc1 -std=c++11 -triple nvptx-nvidia-cuda \5// RUN: -aux-triple i386-windows-msvc -fsyntax-only \6// RUN: -fcuda-is-device -verify %s7 8// RUN: %clang_cc1 -std=c++11 -triple nvptx-nvidia-cuda \9// RUN: -aux-triple x86_64-linux-gnu -fsyntax-only \10// RUN: -fcuda-is-device -verify -verify-ignore-unexpected=note \11// RUN: -DEXPECT_ERR %s12 13// CUDA device code should inherit the host's calling conventions.14 15template <class T>16struct Foo;17 18template <class T>19struct Foo<T()> {};20 21// On x86_64-linux-gnu, this is a redefinition of the template, because the22// __fastcall calling convention doesn't exist (and is therefore ignored).23#ifndef EXPECT_ERR24// expected-no-diagnostics25#else26// expected-error@+4 {{redefinition of 'Foo}}27// expected-warning@+3 {{'__fastcall' calling convention is not supported}}28#endif29template <class T>30struct Foo<T __fastcall()> {};31