]> granicus.if.org Git - clang/commitdiff
Move all CUDA testing inputs to Inputs/ subdirectory inside the tests.
authorEli Bendersky <eliben@google.com>
Mon, 28 Apr 2014 22:21:28 +0000 (22:21 +0000)
committerEli Bendersky <eliben@google.com>
Mon, 28 Apr 2014 22:21:28 +0000 (22:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207453 91177308-0d34-0410-b5e6-96231b3b80d8

14 files changed:
test/CodeGenCUDA/Inputs/cuda.h [moved from test/SemaCUDA/cuda.h with 100% similarity]
test/CodeGenCUDA/address-spaces.cu
test/CodeGenCUDA/device-stub.cu
test/CodeGenCUDA/filter-decl.cu
test/CodeGenCUDA/kernel-call.cu
test/CodeGenCUDA/launch-bounds.cu
test/CodeGenCUDA/ptx-kernels.cu
test/PCH/Inputs/cuda.h [new file with mode: 0644]
test/PCH/cuda-kernel-call.cu
test/SemaCUDA/Inputs/cuda.h [new file with mode: 0644]
test/SemaCUDA/function-target.cu
test/SemaCUDA/kernel-call.cu
test/SemaCUDA/launch_bounds.cu
test/SemaCUDA/qualifiers.cu

index a28886f4b1a1ce3b74fe24ef7d3b4958127f9711..b80820683f3eb4484ad071b89728f0c91e10ff2f 100644 (file)
@@ -3,7 +3,7 @@
 // Verifies Clang emits correct address spaces and addrspacecast instructions
 // for CUDA code.
 
-#include "../SemaCUDA/cuda.h"
+#include "Inputs/cuda.h"
 
 // CHECK: @i = addrspace(1) global
 __device__ int i;
index af73ea993f457880dfe02aba8f4df553a587a5d3..ed94d108487c440b86be85251f4ae16ef95d914b 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
 
-#include "../SemaCUDA/cuda.h"
+#include "Inputs/cuda.h"
 
 // Test that we build the correct number of calls to cudaSetupArgument followed
 // by a call to cudaLaunch.
index 008eaaed88bde4bdd7f12fb5e9462eb4e215abcc..faaeb69fe1c72ea2c6ee43062c0d2f1b5a47f4bf 100644 (file)
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-HOST %s
 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - -fcuda-is-device | FileCheck -check-prefix=CHECK-DEVICE %s
 
-#include "../SemaCUDA/cuda.h"
+#include "Inputs/cuda.h"
 
 // CHECK-HOST-NOT: constantdata = global
 // CHECK-DEVICE: constantdata = global
index f134624eec19837c09fa45c99713940356220453..9b849db908f8afe4fed240695a295f69a2d86abe 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
 
-#include "../SemaCUDA/cuda.h"
+#include "Inputs/cuda.h"
 
 __global__ void g1(int x) {}
 
index 3f88aeb7e71492e531496563e6b8439d8bf67991..ed4c2bfc88703f0239e358f2df2cea22a61ac55d 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 %s -triple nvptx-unknown-unknown -fcuda-is-device -emit-llvm -o - | FileCheck %s
 
-#include "../SemaCUDA/cuda.h"
+#include "Inputs/cuda.h"
 
 #define MAX_THREADS_PER_BLOCK 256
 #define MIN_BLOCKS_PER_MP     2
index 211692fcc7c01a5aab5f7b33b139c646d5d4599f..11b92b587606fa64d889568cb7e37170d3b1ec3e 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 %s -triple nvptx-unknown-unknown -fcuda-is-device -emit-llvm -o - | FileCheck %s
 
-#include "../SemaCUDA/cuda.h"
+#include "Inputs/cuda.h"
 
 // CHECK-LABEL: define void @device_function
 extern "C"
diff --git a/test/PCH/Inputs/cuda.h b/test/PCH/Inputs/cuda.h
new file mode 100644 (file)
index 0000000..a9a4595
--- /dev/null
@@ -0,0 +1,20 @@
+/* Minimal declarations for CUDA support.  Testing purposes only. */
+
+#include <stddef.h>
+
+#define __constant__ __attribute__((constant))
+#define __device__ __attribute__((device))
+#define __global__ __attribute__((global))
+#define __host__ __attribute__((host))
+#define __shared__ __attribute__((shared))
+#define __launch_bounds__(...) __attribute__((launch_bounds(__VA_ARGS__)))
+
+struct dim3 {
+  unsigned x, y, z;
+  __host__ __device__ dim3(unsigned x, unsigned y = 1, unsigned z = 1) : x(x), y(y), z(z) {}
+};
+
+typedef struct cudaStream *cudaStream_t;
+
+int cudaConfigureCall(dim3 gridSize, dim3 blockSize, size_t sharedSize = 0,
+                      cudaStream_t stream = 0);
index ef12c5920745c6d4e0bd4a296b27485276d9b53f..ffb0c1444fe69a6ae3478b3e9e76ca9b01f84ab1 100644 (file)
@@ -5,7 +5,7 @@
 #define HEADER
 // Header.
 
-#include "../SemaCUDA/cuda.h"
+#include "Inputs/cuda.h"
 
 void kcall(void (*kp)()) {
   kp<<<1, 1>>>();
diff --git a/test/SemaCUDA/Inputs/cuda.h b/test/SemaCUDA/Inputs/cuda.h
new file mode 100644 (file)
index 0000000..a9a4595
--- /dev/null
@@ -0,0 +1,20 @@
+/* Minimal declarations for CUDA support.  Testing purposes only. */
+
+#include <stddef.h>
+
+#define __constant__ __attribute__((constant))
+#define __device__ __attribute__((device))
+#define __global__ __attribute__((global))
+#define __host__ __attribute__((host))
+#define __shared__ __attribute__((shared))
+#define __launch_bounds__(...) __attribute__((launch_bounds(__VA_ARGS__)))
+
+struct dim3 {
+  unsigned x, y, z;
+  __host__ __device__ dim3(unsigned x, unsigned y = 1, unsigned z = 1) : x(x), y(y), z(z) {}
+};
+
+typedef struct cudaStream *cudaStream_t;
+
+int cudaConfigureCall(dim3 gridSize, dim3 blockSize, size_t sharedSize = 0,
+                      cudaStream_t stream = 0);
index c7a55e2fad83c38fc700ad7fc450ba6e818d0bd5..51bc8c9f559e977aab58ac921bec41de8377cef9 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
-#include "cuda.h"
+#include "Inputs/cuda.h"
 
 __host__ void h1h(void);
 __device__ void h1d(void); // expected-note {{candidate function not viable: call to __device__ function from __host__ function}}
index 91b1d49e2d064378b1c04d99e84b46f9007c68c8..9a3d86c47fa076e9a948962e2232bed376b485ca 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
-#include "cuda.h"
+#include "Inputs/cuda.h"
 
 __global__ void g1(int x) {}
 
index a1a4e64f1ca8fb772ec71ad138896b99b70ce2b1..bed7658aed595c0337ed7bd0865be2869f23bec4 100644 (file)
@@ -1,14 +1,14 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s\r
-\r
-#include "cuda.h"\r
-\r
-__launch_bounds__(128, 7) void Test1(void);\r
-__launch_bounds__(128) void Test2(void);\r
-\r
-__launch_bounds__(1, 2, 3) void Test3(void); // expected-error {{'launch_bounds' attribute takes no more than 2 arguments}}\r
-\r
-// FIXME: the error should read that the attribute takes exactly one or two arguments, but there\r
-// is no support for such a diagnostic currently.\r
-__launch_bounds__() void Test4(void); // expected-error {{'launch_bounds' attribute takes no more than 2 arguments}}\r
-\r
-int Test5 __launch_bounds__(128, 7); // expected-warning {{'launch_bounds' attribute only applies to functions and methods}}\r
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+#include "Inputs/cuda.h"
+
+__launch_bounds__(128, 7) void Test1(void);
+__launch_bounds__(128) void Test2(void);
+
+__launch_bounds__(1, 2, 3) void Test3(void); // expected-error {{'launch_bounds' attribute takes no more than 2 arguments}}
+
+// FIXME: the error should read that the attribute takes exactly one or two arguments, but there
+// is no support for such a diagnostic currently.
+__launch_bounds__() void Test4(void); // expected-error {{'launch_bounds' attribute takes no more than 2 arguments}}
+
+int Test5 __launch_bounds__(128, 7); // expected-warning {{'launch_bounds' attribute only applies to functions and methods}}
index 1346d654b8c419f54f02c089af56be571d2ffa46..42a80b8b38c77966f1aebc9b942f6ba1f300d55a 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
-#include "cuda.h"
+#include "Inputs/cuda.h"
 
 __global__ void g1(int x) {}
 __global__ int g2(int x) { // expected-error {{must have void return type}}