summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCUDA/function-overload.cu
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-10-19 00:06:49 +0000
committerJustin Lebar <jlebar@google.com>2016-10-19 00:06:49 +0000
commitd3fd70dedd75f9b27f7198840a1ada82d54b95ab (patch)
tree13643e417a8d8d574929e75251dfce4f61a47bf9 /clang/test/SemaCUDA/function-overload.cu
parentb47711ab274e2de40e014dc72d9d87f884a893d7 (diff)
downloadbcm5719-llvm-d3fd70dedd75f9b27f7198840a1ada82d54b95ab.tar.gz
bcm5719-llvm-d3fd70dedd75f9b27f7198840a1ada82d54b95ab.zip
[CUDA] Rework tests now that we emit deferred diagnostics during sema. Test-only change.
Summary: Previously we had to split out a lot of our tests into a test that checked only immediate errors and a test that checked only deferred errors. This was because, if you emitted any immediate errors, we wouldn't run codegen, where the deferred errors were emitted. We've fixed this, and now emit deferred errors during sema. This lets us merge a bunch of tests, and lets us convert some other tests to -fsyntax-only. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25755 llvm-svn: 284553
Diffstat (limited to 'clang/test/SemaCUDA/function-overload.cu')
-rw-r--r--clang/test/SemaCUDA/function-overload.cu10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaCUDA/function-overload.cu b/clang/test/SemaCUDA/function-overload.cu
index 4545a808759..161a54ef35f 100644
--- a/clang/test/SemaCUDA/function-overload.cu
+++ b/clang/test/SemaCUDA/function-overload.cu
@@ -193,12 +193,22 @@ __host__ __device__ void hostdevicef() {
CurrentFnPtr fp_cdh = cdh;
CurrentReturnTy ret_cdh = cdh();
+ GlobalFnPtr fp_g = g;
+#if defined(__CUDA_ARCH__)
+ // expected-error@-2 {{reference to __global__ function 'g' in __host__ __device__ function}}
+#endif
+
g();
#if defined (__CUDA_ARCH__)
// expected-error@-2 {{reference to __global__ function 'g' in __host__ __device__ function}}
#else
// expected-error@-4 {{call to global function g not configured}}
#endif
+
+ g<<<0,0>>>();
+#if defined(__CUDA_ARCH__)
+ // expected-error@-2 {{reference to __global__ function 'g' in __host__ __device__ function}}
+#endif
}
// Test for address of overloaded function resolution in the global context.
OpenPOWER on IntegriCloud