summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaOpenCLCXX/address-space-deduction.cl
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaOpenCLCXX/address-space-deduction.cl')
-rw-r--r--clang/test/SemaOpenCLCXX/address-space-deduction.cl20
1 files changed, 17 insertions, 3 deletions
diff --git a/clang/test/SemaOpenCLCXX/address-space-deduction.cl b/clang/test/SemaOpenCLCXX/address-space-deduction.cl
index d6dcc853a60..6b2a07cad74 100644
--- a/clang/test/SemaOpenCLCXX/address-space-deduction.cl
+++ b/clang/test/SemaOpenCLCXX/address-space-deduction.cl
@@ -1,12 +1,26 @@
-//RUN: %clang_cc1 %s -cl-std=c++ -pedantic -ast-dump -verify
+//RUN: %clang_cc1 %s -cl-std=c++ -pedantic -ast-dump -verify | FileCheck %s
//expected-no-diagnostics
-//CHECK: |-VarDecl foo {{.*}} 'const __global int' constexpr cinit
+//CHECK: |-VarDecl {{.*}} foo 'const __global int'
constexpr int foo = 0;
class c {
public:
- //CHECK: `-VarDecl {{.*}} foo2 'const __global int' static constexpr cinit
+ //CHECK: `-VarDecl {{.*}} foo2 'const __global int'
static constexpr int foo2 = 0;
};
+
+struct c1 {};
+
+// We only deduce addr space in type alias in pointer types.
+//CHECK: TypeAliasDecl {{.*}} alias_c1 'c1'
+using alias_c1 = c1;
+//CHECK: TypeAliasDecl {{.*}} alias_c1_ptr '__generic c1 *'
+using alias_c1_ptr = c1 *;
+
+struct c2 {
+ alias_c1 y;
+ alias_c1_ptr ptr = &y;
+};
+
OpenPOWER on IntegriCloud