summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
authorAnastasia Stulova <anastasia.stulova@arm.com>2015-09-30 13:49:55 +0000
committerAnastasia Stulova <anastasia.stulova@arm.com>2015-09-30 13:49:55 +0000
commite6e082348d5125cbf7a0027d208f28d9f12f2832 (patch)
tree377aabb7db490d24f67edfce4f35885e0a15ab24 /clang/test/Sema
parentb926d01d2a7f7c32aa7931b78d3704045b7b0f9c (diff)
downloadbcm5719-llvm-e6e082348d5125cbf7a0027d208f28d9f12f2832.tar.gz
bcm5719-llvm-e6e082348d5125cbf7a0027d208f28d9f12f2832.zip
[OpenCL] Add missing OpenCL LangOpts in address space compatibility checks
and test checking broken (due to CL specific diagnostics) C functionality M test/Sema/address_spaces.c M lib/Sema/SemaExpr.cpp llvm-svn: 248902
Diffstat (limited to 'clang/test/Sema')
-rw-r--r--clang/test/Sema/address_spaces.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/Sema/address_spaces.c b/clang/test/Sema/address_spaces.c
index 4756af9d952..1922c8ae4f6 100644
--- a/clang/test/Sema/address_spaces.c
+++ b/clang/test/Sema/address_spaces.c
@@ -67,3 +67,8 @@ void access_as_field()
typedef int PR4997 __attribute__((address_space(Foobar))); // expected-error {{use of undeclared identifier 'Foobar'}}
__attribute__((address_space("12"))) int *i; // expected-error {{'address_space' attribute requires an integer constant}}
+
+// Clang extension doesn't forbid operations on pointers to different address spaces.
+char* cmp(_AS1 char *x, _AS2 char *y) {
+ return x < y ? x : y; // expected-warning {{pointer type mismatch ('__attribute__((address_space(1))) char *' and '__attribute__((address_space(2))) char *')}}
+} \ No newline at end of file
OpenPOWER on IntegriCloud