mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-23 05:25:50 -04:00

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
24 lines
689 B
C++
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>();
|
|
}
|