annotate clang/test/SemaCUDA/implicit-member-target-collision.cu @ 165:597b3f1c2c93

fix call createTailCallEliminationPass
author anatofuz
date Tue, 24 Mar 2020 15:30:52 +0900
parents 1d019706d866
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 #include "Inputs/cuda.h"
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 //------------------------------------------------------------------------------
anatofuz
parents:
diff changeset
6 // Test 1: collision between two bases
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 struct A1_with_host_ctor {
anatofuz
parents:
diff changeset
9 A1_with_host_ctor() {}
anatofuz
parents:
diff changeset
10 };
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 struct B1_with_device_ctor {
anatofuz
parents:
diff changeset
13 __device__ B1_with_device_ctor() {}
anatofuz
parents:
diff changeset
14 };
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 struct C1_with_collision : A1_with_host_ctor, B1_with_device_ctor {
anatofuz
parents:
diff changeset
17 };
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 // expected-note@-3 {{candidate constructor (the implicit default constructor}} not viable
anatofuz
parents:
diff changeset
20 // expected-note@-4 {{implicit default constructor inferred target collision: call to both __host__ and __device__ members}}
anatofuz
parents:
diff changeset
21 // expected-note@-5 {{candidate constructor (the implicit copy constructor}} not viable
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 void hostfoo1() {
anatofuz
parents:
diff changeset
24 C1_with_collision c; // expected-error {{no matching constructor}}
anatofuz
parents:
diff changeset
25 }
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 //------------------------------------------------------------------------------
anatofuz
parents:
diff changeset
28 // Test 2: collision between two fields
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 struct C2_with_collision {
anatofuz
parents:
diff changeset
31 A1_with_host_ctor aa;
anatofuz
parents:
diff changeset
32 B1_with_device_ctor bb;
anatofuz
parents:
diff changeset
33 };
anatofuz
parents:
diff changeset
34
anatofuz
parents:
diff changeset
35 // expected-note@-5 {{candidate constructor (the implicit default constructor}} not viable
anatofuz
parents:
diff changeset
36 // expected-note@-6 {{implicit default constructor inferred target collision: call to both __host__ and __device__ members}}
anatofuz
parents:
diff changeset
37 // expected-note@-7 {{candidate constructor (the implicit copy constructor}} not viable
anatofuz
parents:
diff changeset
38
anatofuz
parents:
diff changeset
39 void hostfoo2() {
anatofuz
parents:
diff changeset
40 C2_with_collision c; // expected-error {{no matching constructor}}
anatofuz
parents:
diff changeset
41
anatofuz
parents:
diff changeset
42 }
anatofuz
parents:
diff changeset
43
anatofuz
parents:
diff changeset
44 //------------------------------------------------------------------------------
anatofuz
parents:
diff changeset
45 // Test 3: collision between a field and a base
anatofuz
parents:
diff changeset
46
anatofuz
parents:
diff changeset
47 struct C3_with_collision : A1_with_host_ctor {
anatofuz
parents:
diff changeset
48 B1_with_device_ctor bb;
anatofuz
parents:
diff changeset
49 };
anatofuz
parents:
diff changeset
50
anatofuz
parents:
diff changeset
51 // expected-note@-4 {{candidate constructor (the implicit default constructor}} not viable
anatofuz
parents:
diff changeset
52 // expected-note@-5 {{implicit default constructor inferred target collision: call to both __host__ and __device__ members}}
anatofuz
parents:
diff changeset
53 // expected-note@-6 {{candidate constructor (the implicit copy constructor}} not viable
anatofuz
parents:
diff changeset
54
anatofuz
parents:
diff changeset
55 void hostfoo3() {
anatofuz
parents:
diff changeset
56 C3_with_collision c; // expected-error {{no matching constructor}}
anatofuz
parents:
diff changeset
57 }