1 // Test without serialization: 2 // RUN: %clang_cc1 %s -ast-dump | FileCheck %s 3 // 4 // Test with serialization: 5 // RUN: %clang_cc1 -emit-pch -o %t %s 6 // RUN: %clang_cc1 -x c++ -include-pch %t -ast-dump-all /dev/null \ 7 // RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \ 8 // RUN: | FileCheck %s 9 10 // Verify that the language address space attribute is 11 // understood correctly by clang. 12 13 void langas() { 14 // CHECK: VarDecl {{.*}} x_global '__global int *' 15 __attribute__((opencl_global)) int *x_global; 16 17 // CHECK: VarDecl {{.*}} z_global '__global int *' 18 [[clang::opencl_global]] int *z_global; 19 20 // CHECK: VarDecl {{.*}} x_global_device '__global_device int *' 21 __attribute__((opencl_global_device)) int *x_global_device; 22 23 // CHECK: VarDecl {{.*}} z_global_device '__global_device int *' 24 [[clang::opencl_global_device]] int *z_global_device; 25 26 // CHECK: VarDecl {{.*}} x_global_host '__global_host int *' 27 __attribute__((opencl_global_host)) int *x_global_host; 28 29 // CHECK: VarDecl {{.*}} z_global_host '__global_host int *' 30 [[clang::opencl_global_host]] int *z_global_host; 31 32 // CHECK: VarDecl {{.*}} x_local '__local int *' 33 __attribute__((opencl_local)) int *x_local; 34 35 // CHECK: VarDecl {{.*}} z_local '__local int *' 36 [[clang::opencl_local]] int *z_local; 37 38 // CHECK: VarDecl {{.*}} x_constant '__constant int *' 39 __attribute__((opencl_constant)) int *x_constant; 40 41 // CHECK: VarDecl {{.*}} z_constant '__constant int *' 42 [[clang::opencl_constant]] int *z_constant; 43 44 // CHECK: VarDecl {{.*}} x_private '__private int *' 45 __attribute__((opencl_private)) int *x_private; 46 47 // CHECK: VarDecl {{.*}} z_private '__private int *' 48 [[clang::opencl_private]] int *z_private; 49 50 // CHECK: VarDecl {{.*}} x_generic '__generic int *' 51 __attribute__((opencl_generic)) int *x_generic; 52 53 // CHECK: VarDecl {{.*}} z_generic '__generic int *' 54 [[clang::opencl_generic]] int *z_generic; 55 } 56