teak-llvm/clang/test/AST/address_space_attribute.cpp
Leonard Chan 009f9e8231 [Sema] Fix Modified Type in address_space AttributedType
This is a fix for https://reviews.llvm.org/D51229 where we pass the
address_space qualified type as the modified type of an AttributedType. This
change now instead wraps the AttributedType with either the address_space
qualifier or a DependentAddressSpaceType.

Differential Revision: https://reviews.llvm.org/D55447

llvm-svn: 351997
2019-01-24 00:11:35 +00:00

24 lines
689 B
C++

// RUN: %clang_cc1 %s -ast-dump | FileCheck %s
// Veryify the ordering of the address_space attribute still comes before the
// type whereas other attributes are still printed after.
template <int I>
void func() {
// CHECK: VarDecl {{.*}} x '__attribute__((address_space(1))) int *'
__attribute__((address_space(1))) int *x;
// CHECK: VarDecl {{.*}} a 'int * __attribute__((noderef))'
int __attribute__((noderef)) * a;
// CHECK: VarDecl {{.*}} y '__attribute__((address_space(2))) int *'
__attribute__((address_space(I))) int *y;
// CHECK: VarDecl {{.*}} z '__attribute__((address_space(3))) int *'
[[clang::address_space(3)]] int *z;
}
void func2() {
func<2>();
}