blob: 881f2945b1b34738172d001d6cfee436a1cf7c7a [file] [log] [blame]
Justin Lebar86c4e632017-01-05 16:53:38 +00001// RUN: %clang_cc1 -std=c++11 -triple i386-windows-msvc \
2// RUN: -aux-triple nvptx-nvidia-cuda -fsyntax-only -verify %s
3
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 %s
7
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 %s
12
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 the
22// __fastcall calling convention doesn't exist (and is therefore ignored).
23#ifndef EXPECT_ERR
24// expected-no-diagnostics
25#else
26// expected-error@+4 {{redefinition of 'Foo}}
Erich Keane505427c2019-03-21 13:30:56 +000027// expected-warning@+3 {{'__fastcall' calling convention ignored}}
Justin Lebar86c4e632017-01-05 16:53:38 +000028#endif
29template <class T>
30struct Foo<T __fastcall()> {};