]> granicus.if.org Git - clang/commitdiff
[CUDA] Simplify some repeated diagnostic expectations in CUDA tests.
authorJustin Lebar <jlebar@google.com>
Fri, 21 Oct 2016 20:50:47 +0000 (20:50 +0000)
committerJustin Lebar <jlebar@google.com>
Fri, 21 Oct 2016 20:50:47 +0000 (20:50 +0000)
Instead of repeating the diagnostic, use "expected-note N".

Test-only change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284882 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCUDA/bad-calls-on-same-line.cu
test/SemaCUDA/call-device-fn-from-host.cu
test/SemaCUDA/call-host-fn-from-device.cu
test/SemaCUDA/trace-through-global.cu

index 53d5e128234030cb46cf5925075bbbe246ff089d..67923323a94fa5fd8af93c8ed322fdb3b509b07a 100644 (file)
@@ -28,8 +28,7 @@ struct Selector<double> {
 template <typename T>
 inline __host__ __device__ void hd() {
   Selector<T>().f();
-  // expected-error@-1 {{reference to __device__ function}}
-  // expected-error@-2 {{reference to __device__ function}}
+  // expected-error@-1 2 {{reference to __device__ function}}
 }
 
 void host_fn() {
index dc22722610154f6f3d20dfeb0563c67e5ff0dcea..3ea013f3a742af0a747074d25b6e4500b7cee035 100644 (file)
@@ -7,16 +7,11 @@
 #include "Inputs/cuda.h"
 
 __device__ void device_fn() {}
-// expected-note@-1 {{'device_fn' declared here}}
-// expected-note@-2 {{'device_fn' declared here}}
-// expected-note@-3 {{'device_fn' declared here}}
-// expected-note@-4 {{'device_fn' declared here}}
-// expected-note@-5 {{'device_fn' declared here}}
+// expected-note@-1 5 {{'device_fn' declared here}}
 
 struct S {
   __device__ S() {}
-  // expected-note@-1 {{'S' declared here}}
-  // expected-note@-2 {{'S' declared here}}
+  // expected-note@-1 2 {{'S' declared here}}
   __device__ ~S() { device_fn(); }
   // expected-note@-1 {{'~S' declared here}}
   int x;
index d484af141726898eca15327be459934650149c4a..c727dc8cbeb7110eaf5fbc015ca4be62b55a902f 100644 (file)
@@ -7,20 +7,13 @@
 #include "Inputs/cuda.h"
 
 extern "C" void host_fn() {}
-// expected-note@-1 {{'host_fn' declared here}}
-// expected-note@-2 {{'host_fn' declared here}}
-// expected-note@-3 {{'host_fn' declared here}}
-// expected-note@-4 {{'host_fn' declared here}}
-// expected-note@-5 {{'host_fn' declared here}}
-// expected-note@-6 {{'host_fn' declared here}}
-// expected-note@-7 {{'host_fn' declared here}}
+// expected-note@-1 7 {{'host_fn' declared here}}
 
 struct Dummy {};
 
 struct S {
   S() {}
-  // expected-note@-1 {{'S' declared here}}
-  // expected-note@-2 {{'S' declared here}}
+  // expected-note@-1 2 {{'S' declared here}}
   ~S() { host_fn(); }
   // expected-note@-1 {{'~S' declared here}}
   int x;
index 065342fdd11bb7c87a2d918ee65ec4290c5f6ec0..f73570fa664587055b5cd5e86e1c17fb092068f3 100644 (file)
@@ -6,8 +6,7 @@
 #include "Inputs/cuda.h"
 
 __device__ void device_fn(int) {}
-// expected-note@-1 {{declared here}}
-// expected-note@-2 {{declared here}}
+// expected-note@-1 2 {{declared here}}
 
 inline __host__ __device__ int hd1() {
   device_fn(0);  // expected-error {{reference to __device__ function}}
@@ -45,6 +44,5 @@ void launch_kernel() {
 
 void host_fn() {
   launch_kernel<int>();
-  // expected-note@-1 {{called by 'host_fn'}}
-  // expected-note@-2 {{called by 'host_fn'}}
+  // expected-note@-1 2 {{called by 'host_fn'}}
 }