1
- // RUN: %clang_cc1 -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +sme -verify=expected,notc2x -Wno-strict-prototypes %s
2
- // RUN: %clang_cc1 -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +sme -verify=expected,c2x %s
3
-
4
- enum __arm_inout ("za" ) E { // expected-error {{'__arm_inout' only applies to non-K&R-style functions}}
5
- One __arm_inout ("za" ), // expected-error {{'__arm_inout' only applies to non-K&R-style functions}}
1
+ // RUN: sed -e s/ATTR_USE/__arm_streaming/g -e s/ATTR_NAME/__arm_streaming/g %s > %t
2
+ // RUN: %clang_cc1 -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +sme -verify=expected,notc2x -Wno-strict-prototypes %t
3
+ // RUN: %clang_cc1 -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +sme -verify=expected,c2x %t
4
+ // RUN: sed -e s/ATTR_USE/__arm_inout\(\"za\"\)/g -e s/ATTR_NAME/__arm_inout/g %s > %t
5
+ // RUN: %clang_cc1 -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +sme -verify=expected,notc2x -Wno-strict-prototypes %t
6
+ // RUN: %clang_cc1 -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +sme -verify=expected,c2x %t
7
+
8
+ enum ATTR_USE E { // expected-error {{'ATTR_NAME' only applies to non-K&R-style functions}}
9
+ One ATTR_USE , // expected-error {{'ATTR_NAME' only applies to non-K&R-style functions}}
6
10
Two ,
7
- Three __arm_inout ( "za" ) // expected-error {{'__arm_inout ' only applies to non-K&R-style functions}}
11
+ Three ATTR_USE // expected-error {{'ATTR_NAME ' only applies to non-K&R-style functions}}
8
12
};
9
13
10
- enum __arm_inout ( "za" ) { Four }; // expected-error {{'__arm_inout ' only applies to non-K&R-style functions}}
11
- __arm_inout ( "za" ) enum E2 { Five }; // expected-error {{misplaced '__arm_inout '}}
14
+ enum ATTR_USE { Four }; // expected-error {{'ATTR_NAME ' only applies to non-K&R-style functions}}
15
+ ATTR_USE enum E2 { Five }; // expected-error {{misplaced 'ATTR_NAME '}}
12
16
13
17
// FIXME: this diagnostic can be improved.
14
- enum { __arm_inout (" za ") Six }; // expected-error {{expected identifier}}
18
+ enum { ATTR_USE Six }; // expected-error {{expected identifier}}
15
19
16
20
// FIXME: this diagnostic can be improved.
17
- enum E3 __arm_inout ( "za" ) { Seven }; // expected-error {{expected identifier or '('}}
18
-
19
- struct __arm_inout ( "za" ) S1 { // expected-error {{'__arm_inout ' only applies to non-K&R-style functions}}
20
- int i __arm_inout ( "za" ) ; // expected-error {{'__arm_inout ' only applies to function types}}
21
- int __arm_inout ( "za" ) j ; // expected-error {{'__arm_inout ' only applies to function types}}
22
- int k [10 ] __arm_inout ( "za" ) ; // expected-error {{'__arm_inout ' only applies to function types}}
23
- int l __arm_inout ( "za" ) [10 ]; // expected-error {{'__arm_inout ' only applies to function types}}
24
- __arm_inout ( "za" ) int m , n ; // expected-error {{'__arm_inout ' only applies to function types}}
25
- int o __arm_inout ( "za" ) : 12 ; // expected-error {{'__arm_inout ' only applies to function types}}
26
- int __arm_inout ( "za" ) : 0 ; // expected-error {{'__arm_inout ' only applies to function types}}
27
- int p , __arm_inout (" za ") : 0 ; // expected-error {{'__arm_inout ' cannot appear here}}
28
- int q , __arm_inout (" za ") r ; // expected-error {{'__arm_inout ' cannot appear here}}
29
- __arm_inout (" za ") int ; // expected-error {{'__arm_inout ' cannot appear here}} \
21
+ enum E3 ATTR_USE { Seven }; // expected-error {{expected identifier or '('}}
22
+
23
+ struct ATTR_USE S1 { // expected-error {{'ATTR_NAME ' only applies to non-K&R-style functions}}
24
+ int i ATTR_USE ; // expected-error {{'ATTR_NAME ' only applies to function types}}
25
+ int ATTR_USE j ; // expected-error {{'ATTR_NAME ' only applies to function types}}
26
+ int k [10 ] ATTR_USE ; // expected-error {{'ATTR_NAME ' only applies to function types}}
27
+ int l ATTR_USE [10 ]; // expected-error {{'ATTR_NAME ' only applies to function types}}
28
+ ATTR_USE int m , n ; // expected-error {{'ATTR_NAME ' only applies to function types}}
29
+ int o ATTR_USE : 12 ; // expected-error {{'ATTR_NAME ' only applies to function types}}
30
+ int ATTR_USE : 0 ; // expected-error {{'ATTR_NAME ' only applies to function types}}
31
+ int p , ATTR_USE : 0 ; // expected-error {{'ATTR_NAME ' cannot appear here}}
32
+ int q , ATTR_USE r ; // expected-error {{'ATTR_NAME ' cannot appear here}}
33
+ ATTR_USE int ; // expected-error {{'ATTR_NAME ' cannot appear here}} \
30
34
// expected-warning {{declaration does not declare anything}}
31
35
};
32
36
33
- __arm_inout ( "za" ) struct S2 { int a ; }; // expected-error {{misplaced '__arm_inout '}}
34
- struct S3 __arm_inout ( "za" ) { int a ; }; // expected-error {{'__arm_inout ' cannot appear here}} \
35
- expected-error {{'__arm_inout ' only applies to non-K&R-style functions}}
37
+ ATTR_USE struct S2 { int a ; }; // expected-error {{misplaced 'ATTR_NAME '}}
38
+ struct S3 ATTR_USE { int a ; }; // expected-error {{'ATTR_NAME ' cannot appear here}} \
39
+ expected-error {{'ATTR_NAME ' only applies to non-K&R-style functions}}
36
40
37
- union __arm_inout ( "za" ) U { // expected-error {{'__arm_inout ' only applies to non-K&R-style functions}}
38
- double d __arm_inout ( "za" ) ; // expected-error {{'__arm_inout ' only applies to function types; type here is 'double'}}
39
- __arm_inout ( "za" ) int i ; // expected-error {{'__arm_inout ' only applies to function types; type here is 'int'}}
41
+ union ATTR_USE U { // expected-error {{'ATTR_NAME ' only applies to non-K&R-style functions}}
42
+ double d ATTR_USE ; // expected-error {{'ATTR_NAME ' only applies to function types; type here is 'double'}}
43
+ ATTR_USE int i ; // expected-error {{'ATTR_NAME ' only applies to function types; type here is 'int'}}
40
44
};
41
45
42
- __arm_inout ( "za" ) union U2 { double d ; }; // expected-error {{misplaced '__arm_inout '}}
43
- union U3 __arm_inout ( "za" ) { double d ; }; // expected-error {{'__arm_inout ' cannot appear here}} \
44
- expected-error {{'__arm_inout ' only applies to non-K&R-style functions}}
46
+ ATTR_USE union U2 { double d ; }; // expected-error {{misplaced 'ATTR_NAME '}}
47
+ union U3 ATTR_USE { double d ; }; // expected-error {{'ATTR_NAME ' cannot appear here}} \
48
+ expected-error {{'ATTR_NAME ' only applies to non-K&R-style functions}}
45
49
46
- struct __arm_inout ( "za" ) IncompleteStruct ; // expected-error {{'__arm_inout ' only applies to non-K&R-style functions}}
47
- union __arm_inout ( "za" ) IncompleteUnion ; // expected-error {{'__arm_inout ' only applies to non-K&R-style functions}}
48
- enum __arm_inout ( "za" ) IncompleteEnum ; // expected-error {{'__arm_inout ' only applies to non-K&R-style functions}}
50
+ struct ATTR_USE IncompleteStruct ; // expected-error {{'ATTR_NAME ' only applies to non-K&R-style functions}}
51
+ union ATTR_USE IncompleteUnion ; // expected-error {{'ATTR_NAME ' only applies to non-K&R-style functions}}
52
+ enum ATTR_USE IncompleteEnum ; // expected-error {{'ATTR_NAME ' only applies to non-K&R-style functions}}
49
53
50
- __arm_inout ( "za" ) void f1 (void ); // expected-error {{'__arm_inout ' cannot be applied to a declaration}}
51
- void __arm_inout ( "za" ) f2 (void ); // expected-error {{'__arm_inout ' only applies to function types}}
52
- void f3 __arm_inout ( "za" ) (void ); // expected-error {{'__arm_inout ' cannot be applied to a declaration}}
53
- void f4 (void ) __arm_inout (" za ") ;
54
+ ATTR_USE void f1 (void ); // expected-error {{'ATTR_NAME ' cannot be applied to a declaration}}
55
+ void ATTR_USE f2 (void ); // expected-error {{'ATTR_NAME ' only applies to function types}}
56
+ void f3 ATTR_USE (void ); // expected-error {{'ATTR_NAME ' cannot be applied to a declaration}}
57
+ void f4 (void ) ATTR_USE ;
54
58
55
- void f5 (int i __arm_inout (" za "), __arm_inout (" za ") int j, int __arm_inout(" za ") k); // expected-error 3 {{'__arm_inout ' only applies to function types}}
59
+ void f5 (int i ATTR_USE , ATTR_USE int j , int ATTR_USE k ); // expected-error 3 {{'ATTR_NAME ' only applies to function types}}
56
60
57
- void f6 (a , b ) __arm_inout ( "za" ) int a ; int b ; { // expected-error {{'__arm_inout ' cannot appear here}} \
61
+ void f6 (a , b ) ATTR_USE int a ; int b ; { // expected-error {{'ATTR_NAME ' cannot appear here}} \
58
62
c2x-warning {{deprecated}}
59
63
}
60
64
@@ -63,60 +67,60 @@ void f6(a, b) __arm_inout("za") int a; int b; { // expected-error {{'__arm_inout
63
67
// behavior given that we *don't* want to parse it as part of the K&R parameter
64
68
// declarations. It is disallowed to avoid a parsing ambiguity we already
65
69
// handle well.
66
- int (* f7 (a , b ))(int , int ) __arm_inout (" za ") int a ; int b ; { // c2x-warning {{deprecated}}
70
+ int (* f7 (a , b ))(int , int ) ATTR_USE int a ; int b ; { // c2x-warning {{deprecated}}
67
71
return 0 ;
68
72
}
69
73
70
- __arm_inout ( "za" ) int a , b ; // expected-error {{'__arm_inout ' only applies to function types}}
71
- int c __arm_inout ( "za" ) , d __arm_inout ( "za" ) ; // expected-error 2 {{'__arm_inout ' only applies to function types}}
74
+ ATTR_USE int a , b ; // expected-error {{'ATTR_NAME ' only applies to function types}}
75
+ int c ATTR_USE , d ATTR_USE ; // expected-error 2 {{'ATTR_NAME ' only applies to function types}}
72
76
73
- void f8 (void ) __arm_inout (" za ") {
74
- __arm_inout ( "za" ) int i , j ; // expected-error {{'__arm_inout ' only applies to function types}}
75
- int k , l __arm_inout (" za ") ; // expected-error {{'__arm_inout ' only applies to function types}}
77
+ void f8 (void ) ATTR_USE {
78
+ ATTR_USE int i , j ; // expected-error {{'ATTR_NAME ' only applies to function types}}
79
+ int k , l ATTR_USE ; // expected-error {{'ATTR_NAME ' only applies to function types}}
76
80
}
77
81
78
- __arm_inout ( "za" ) void f9 (void ) { // expected-error {{'__arm_inout ' cannot be applied to a declaration}}
79
- int i [10 ] __arm_inout ( "za" ) ; // expected-error {{'__arm_inout ' only applies to function types}}
80
- int (* fp1 )(void )__arm_inout (" za ") ;
81
- int (* fp2 __arm_inout (" za ")) (void ); // expected-error {{'__arm_inout ' cannot be applied to a declaration}}
82
+ ATTR_USE void f9 (void ) { // expected-error {{'ATTR_NAME ' cannot be applied to a declaration}}
83
+ int i [10 ] ATTR_USE ; // expected-error {{'ATTR_NAME ' only applies to function types}}
84
+ int (* fp1 )(void )ATTR_USE ;
85
+ int (* fp2 ATTR_USE ) (void ); // expected-error {{'ATTR_NAME ' cannot be applied to a declaration}}
82
86
83
- int * __arm_inout ( "za" ) * ipp ; // expected-error {{'__arm_inout ' only applies to function types}}
87
+ int * ATTR_USE * ipp ; // expected-error {{'ATTR_NAME ' only applies to function types}}
84
88
}
85
89
86
- void f10 (int j [static 10 ] __arm_inout (" za ") , int k[*] __arm_inout(" za ")) ; // expected-error 2 {{'__arm_inout ' only applies to function types}}
90
+ void f10 (int j [static 10 ] ATTR_USE , int k [* ] ATTR_USE ) ; // expected-error 2 {{'ATTR_NAME ' only applies to function types}}
87
91
88
92
void f11 (void ) {
89
- __arm_inout ( "za" ) {} // expected-error {{'__arm_inout ' cannot be applied to a statement}}
90
- __arm_inout ( "za" ) if (1 ) {} // expected-error {{'__arm_inout ' cannot be applied to a statement}}
93
+ ATTR_USE {} // expected-error {{'ATTR_NAME ' cannot be applied to a statement}}
94
+ ATTR_USE if (1 ) {} // expected-error {{'ATTR_NAME ' cannot be applied to a statement}}
91
95
92
- __arm_inout ( "za" ) switch (1 ) { // expected-error {{'__arm_inout ' cannot be applied to a statement}}
93
- __arm_inout ( "za" ) case 1 : __arm_inout ( "za" ) break ; // expected-error 2 {{'__arm_inout ' cannot be applied to a statement}}
94
- __arm_inout ( "za" ) default : break ; // expected-error {{'__arm_inout ' cannot be applied to a statement}}
96
+ ATTR_USE switch (1 ) { // expected-error {{'ATTR_NAME ' cannot be applied to a statement}}
97
+ ATTR_USE case 1 : ATTR_USE break ; // expected-error 2 {{'ATTR_NAME ' cannot be applied to a statement}}
98
+ ATTR_USE default : break ; // expected-error {{'ATTR_NAME ' cannot be applied to a statement}}
95
99
}
96
100
97
101
goto foo ;
98
- __arm_inout ( "za" ) foo : (void )1 ; // expected-error {{'__arm_inout ' only applies to non-K&R-style functions}}
102
+ ATTR_USE foo : (void )1 ; // expected-error {{'ATTR_NAME ' only applies to non-K&R-style functions}}
99
103
100
- __arm_inout ( "za" ) for (;;); // expected-error {{'__arm_inout ' cannot be applied to a statement}}
101
- __arm_inout ( "za" ) while (1 ); // expected-error {{'__arm_inout ' cannot be applied to a statement}}
102
- __arm_inout ( "za" ) do __arm_inout ( "za" ) { } while (1 ); // expected-error 2 {{'__arm_inout ' cannot be applied to a statement}}
104
+ ATTR_USE for (;;); // expected-error {{'ATTR_NAME ' cannot be applied to a statement}}
105
+ ATTR_USE while (1 ); // expected-error {{'ATTR_NAME ' cannot be applied to a statement}}
106
+ ATTR_USE do ATTR_USE { } while (1 ); // expected-error 2 {{'ATTR_NAME ' cannot be applied to a statement}}
103
107
104
- __arm_inout ( "za" ) (void )1 ; // expected-error {{'__arm_inout ' cannot be applied to a statement}}
108
+ ATTR_USE (void )1 ; // expected-error {{'ATTR_NAME ' cannot be applied to a statement}}
105
109
106
- __arm_inout ( "za" ) ; // expected-error {{'__arm_inout ' cannot be applied to a statement}}
110
+ ATTR_USE ; // expected-error {{'ATTR_NAME ' cannot be applied to a statement}}
107
111
108
- (void )sizeof (int [4 ]__arm_inout ( "za" )) ; // expected-error {{'__arm_inout ' only applies to function types}}
109
- (void )sizeof (struct __arm_inout ( "za" ) S3 { int a __arm_inout ( "za" ) ; }); // expected-error {{'__arm_inout ' only applies to non-K&R-style functions}} \
110
- // expected-error {{'__arm_inout ' only applies to function types; type here is 'int'}}
112
+ (void )sizeof (int [4 ]ATTR_USE ) ; // expected-error {{'ATTR_NAME ' only applies to function types}}
113
+ (void )sizeof (struct ATTR_USE S3 { int a ATTR_USE ; }); // expected-error {{'ATTR_NAME ' only applies to non-K&R-style functions}} \
114
+ // expected-error {{'ATTR_NAME ' only applies to function types; type here is 'int'}}
111
115
112
- __arm_inout ( "za" ) return ; // expected-error {{'__arm_inout ' cannot be applied to a statement}}
116
+ ATTR_USE return ; // expected-error {{'ATTR_NAME ' cannot be applied to a statement}}
113
117
114
- __arm_inout ( "za" ) asm ("" ); // expected-error {{'__arm_inout ' cannot appear here}}
118
+ ATTR_USE asm (""); // expected-error {{'ATTR_NAME ' cannot appear here}}
115
119
}
116
120
117
- struct __arm_inout ( "za" ) S4 * s ; // expected-error {{'__arm_inout ' cannot appear here}}
121
+ struct ATTR_USE S4 * s ; // expected-error {{'ATTR_NAME ' cannot appear here}}
118
122
struct S5 {};
119
- int c = sizeof (struct __arm_inout ( "za" ) S5 ); // expected-error {{'__arm_inout ' cannot appear here}}
123
+ int c = sizeof (struct ATTR_USE S5 ); // expected-error {{'ATTR_NAME ' cannot appear here}}
120
124
121
125
void invalid_parentheses1 () __arm_inout ; // expected-error {{expected '(' after ''__arm_inout''}}
122
126
void invalid_parentheses2 () __arm_inout (; // expected-error {{expected string literal as argument of '__arm_inout' attribute}}
0 commit comments