comparison clang/test/SemaTemplate/address_space-dependent.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
comparison
equal deleted inserted replaced
173:0572611fdcc8 207:2e18cbf3894f
41 __attribute__((address_space(I))) int *bounds; // expected-error {{address space is negative}} 41 __attribute__((address_space(I))) int *bounds; // expected-error {{address space is negative}}
42 } 42 }
43 43
44 template <long int I> 44 template <long int I>
45 void tooBig() { 45 void tooBig() {
46 __attribute__((address_space(I))) int *bounds; // expected-error {{address space is larger than the maximum supported (8388595)}} 46 __attribute__((address_space(I))) int *bounds; // expected-error {{address space is larger than the maximum supported (8388588)}}
47 } 47 }
48 48
49 template <long int I> 49 template <long int I>
50 void correct() { 50 void correct() {
51 __attribute__((address_space(I))) int *bounds; 51 __attribute__((address_space(I))) int *bounds;
99 int p = GetAddressSpaceValue(p1); 99 int p = GetAddressSpaceValue(p1);
100 100
101 car<1, 2, 3>(); // expected-note {{in instantiation of function template specialization 'car<1, 2, 3>' requested here}} 101 car<1, 2, 3>(); // expected-note {{in instantiation of function template specialization 'car<1, 2, 3>' requested here}}
102 HasASTemplateFields<1> HASTF; 102 HasASTemplateFields<1> HASTF;
103 neg<-1>(); // expected-note {{in instantiation of function template specialization 'neg<-1>' requested here}} 103 neg<-1>(); // expected-note {{in instantiation of function template specialization 'neg<-1>' requested here}}
104 correct<0x7FFFF3>(); 104 correct<0x7FFFEB>();
105 tooBig<8388650>(); // expected-note {{in instantiation of function template specialization 'tooBig<8388650>' requested here}} 105 tooBig<8388650>(); // expected-note {{in instantiation of function template specialization 'tooBig<8388650L>' requested here}}
106 106
107 __attribute__((address_space(1))) char *x; 107 __attribute__((address_space(1))) char *x;
108 __attribute__((address_space(2))) char *y; 108 __attribute__((address_space(2))) char *y;
109 cmp<1, 2>(x, y); // expected-note {{in instantiation of function template specialization 'cmp<1, 2>' requested here}} 109 cmp<1, 2>(x, y); // expected-note {{in instantiation of function template specialization 'cmp<1, 2>' requested here}}
110 110