r284882 - [CUDA] Simplify some repeated diagnostic expectations in CUDA tests.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 21 13:50:47 PDT 2016


Author: jlebar
Date: Fri Oct 21 15:50:47 2016
New Revision: 284882

URL: http://llvm.org/viewvc/llvm-project?rev=284882&view=rev
Log:
[CUDA] Simplify some repeated diagnostic expectations in CUDA tests.

Instead of repeating the diagnostic, use "expected-note N".

Test-only change.

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

Modified: cfe/trunk/test/SemaCUDA/bad-calls-on-same-line.cu
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCUDA/bad-calls-on-same-line.cu?rev=284882&r1=284881&r2=284882&view=diff
==============================================================================
--- cfe/trunk/test/SemaCUDA/bad-calls-on-same-line.cu (original)
+++ cfe/trunk/test/SemaCUDA/bad-calls-on-same-line.cu Fri Oct 21 15:50:47 2016
@@ -28,8 +28,7 @@ struct Selector<double> {
 template <typename T>
 inline __host__ __device__ void hd() {
   Selector<T>().f();
-  // expected-error at -1 {{reference to __device__ function}}
-  // expected-error at -2 {{reference to __device__ function}}
+  // expected-error at -1 2 {{reference to __device__ function}}
 }
 
 void host_fn() {

Modified: cfe/trunk/test/SemaCUDA/call-device-fn-from-host.cu
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCUDA/call-device-fn-from-host.cu?rev=284882&r1=284881&r2=284882&view=diff
==============================================================================
--- cfe/trunk/test/SemaCUDA/call-device-fn-from-host.cu (original)
+++ cfe/trunk/test/SemaCUDA/call-device-fn-from-host.cu Fri Oct 21 15:50:47 2016
@@ -7,16 +7,11 @@
 #include "Inputs/cuda.h"
 
 __device__ void device_fn() {}
-// expected-note at -1 {{'device_fn' declared here}}
-// expected-note at -2 {{'device_fn' declared here}}
-// expected-note at -3 {{'device_fn' declared here}}
-// expected-note at -4 {{'device_fn' declared here}}
-// expected-note at -5 {{'device_fn' declared here}}
+// expected-note at -1 5 {{'device_fn' declared here}}
 
 struct S {
   __device__ S() {}
-  // expected-note at -1 {{'S' declared here}}
-  // expected-note at -2 {{'S' declared here}}
+  // expected-note at -1 2 {{'S' declared here}}
   __device__ ~S() { device_fn(); }
   // expected-note at -1 {{'~S' declared here}}
   int x;

Modified: cfe/trunk/test/SemaCUDA/call-host-fn-from-device.cu
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCUDA/call-host-fn-from-device.cu?rev=284882&r1=284881&r2=284882&view=diff
==============================================================================
--- cfe/trunk/test/SemaCUDA/call-host-fn-from-device.cu (original)
+++ cfe/trunk/test/SemaCUDA/call-host-fn-from-device.cu Fri Oct 21 15:50:47 2016
@@ -7,20 +7,13 @@
 #include "Inputs/cuda.h"
 
 extern "C" void host_fn() {}
-// expected-note at -1 {{'host_fn' declared here}}
-// expected-note at -2 {{'host_fn' declared here}}
-// expected-note at -3 {{'host_fn' declared here}}
-// expected-note at -4 {{'host_fn' declared here}}
-// expected-note at -5 {{'host_fn' declared here}}
-// expected-note at -6 {{'host_fn' declared here}}
-// expected-note at -7 {{'host_fn' declared here}}
+// expected-note at -1 7 {{'host_fn' declared here}}
 
 struct Dummy {};
 
 struct S {
   S() {}
-  // expected-note at -1 {{'S' declared here}}
-  // expected-note at -2 {{'S' declared here}}
+  // expected-note at -1 2 {{'S' declared here}}
   ~S() { host_fn(); }
   // expected-note at -1 {{'~S' declared here}}
   int x;

Modified: cfe/trunk/test/SemaCUDA/trace-through-global.cu
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCUDA/trace-through-global.cu?rev=284882&r1=284881&r2=284882&view=diff
==============================================================================
--- cfe/trunk/test/SemaCUDA/trace-through-global.cu (original)
+++ cfe/trunk/test/SemaCUDA/trace-through-global.cu Fri Oct 21 15:50:47 2016
@@ -6,8 +6,7 @@
 #include "Inputs/cuda.h"
 
 __device__ void device_fn(int) {}
-// expected-note at -1 {{declared here}}
-// expected-note at -2 {{declared here}}
+// expected-note at -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 at -1 {{called by 'host_fn'}}
-  // expected-note at -2 {{called by 'host_fn'}}
+  // expected-note at -1 2 {{called by 'host_fn'}}
 }




More information about the cfe-commits mailing list