36
36
; FIXME we should recognize this as UB and make it an unreachable.
37
37
38
38
define dso_local i16 @foo (i16 %a ) {
39
- ; CHECK-LABEL: define {{[^@]+}}@foo
40
- ; CHECK-SAME: (i16 [[A:%.*]]) {
41
- ; CHECK-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]])
42
- ; CHECK-NEXT: ret i16 [[CALL]]
39
+ ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo
40
+ ; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) {
41
+ ; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]])
42
+ ; NOT_CGSCC_NPM-NEXT: ret i16 [[CALL]]
43
+ ;
44
+ ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone
45
+ ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@foo
46
+ ; IS__CGSCC_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
47
+ ; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]])
48
+ ; IS__CGSCC_NPM-NEXT: ret i16 [[CALL]]
43
49
;
44
50
%call = call i16 bitcast (i16 (i16 , i16 ) * @bar to i16 (i16 ) *)(i16 %a )
45
51
ret i16 %call
@@ -51,19 +57,30 @@ define internal i16 @bar(i16 %p1, i16 %p2) {
51
57
; IS__TUNIT____-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0:[0-9]+]] {
52
58
; IS__TUNIT____-NEXT: ret i16 0
53
59
;
54
- ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
55
- ; IS__CGSCC____-LABEL: define {{[^@]+}}@bar
56
- ; IS__CGSCC____-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0:[0-9]+]] {
57
- ; IS__CGSCC____-NEXT: ret i16 0
60
+ ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
61
+ ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bar
62
+ ; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0:[0-9]+]] {
63
+ ; IS__CGSCC_OPM-NEXT: ret i16 0
64
+ ;
65
+ ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
66
+ ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bar
67
+ ; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR1:[0-9]+]] {
68
+ ; IS__CGSCC_NPM-NEXT: ret i16 0
58
69
;
59
70
ret i16 0
60
71
}
61
72
62
73
define dso_local i16 @foo2 (i16 %a ) {
63
- ; CHECK-LABEL: define {{[^@]+}}@foo2
64
- ; CHECK-SAME: (i16 [[A:%.*]]) {
65
- ; CHECK-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar2 to i16 (i16)*)(i16 [[A]])
66
- ; CHECK-NEXT: ret i16 [[CALL]]
74
+ ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo2
75
+ ; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) {
76
+ ; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar2 to i16 (i16)*)(i16 [[A]])
77
+ ; NOT_CGSCC_NPM-NEXT: ret i16 [[CALL]]
78
+ ;
79
+ ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone
80
+ ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@foo2
81
+ ; IS__CGSCC_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0]] {
82
+ ; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar2 to i16 (i16)*)(i16 [[A]])
83
+ ; IS__CGSCC_NPM-NEXT: ret i16 [[CALL]]
67
84
;
68
85
%call = call i16 bitcast (i16 (i16 , i16 ) * @bar2 to i16 (i16 ) *)(i16 %a )
69
86
ret i16 %call
@@ -76,11 +93,17 @@ define internal i16 @bar2(i16 %p1, i16 %p2) {
76
93
; IS__TUNIT____-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]]
77
94
; IS__TUNIT____-NEXT: ret i16 [[A]]
78
95
;
79
- ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
80
- ; IS__CGSCC____-LABEL: define {{[^@]+}}@bar2
81
- ; IS__CGSCC____-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0]] {
82
- ; IS__CGSCC____-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]]
83
- ; IS__CGSCC____-NEXT: ret i16 [[A]]
96
+ ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
97
+ ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bar2
98
+ ; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0]] {
99
+ ; IS__CGSCC_OPM-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]]
100
+ ; IS__CGSCC_OPM-NEXT: ret i16 [[A]]
101
+ ;
102
+ ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
103
+ ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bar2
104
+ ; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR1]] {
105
+ ; IS__CGSCC_NPM-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]]
106
+ ; IS__CGSCC_NPM-NEXT: ret i16 [[A]]
84
107
;
85
108
%a = add i16 %p1 , %p2
86
109
ret i16 %a
@@ -93,11 +116,18 @@ define internal i16 @bar2(i16 %p1, i16 %p2) {
93
116
; been provided),
94
117
95
118
define dso_local i16 @vararg_tests (i16 %a ) {
96
- ; CHECK-LABEL: define {{[^@]+}}@vararg_tests
97
- ; CHECK-SAME: (i16 [[A:%.*]]) {
98
- ; CHECK-NEXT: [[CALL2:%.*]] = call i16 bitcast (i16 (i16, i16, ...)* @vararg_no_prop to i16 (i16)*)(i16 noundef 7)
99
- ; CHECK-NEXT: [[ADD:%.*]] = add i16 7, [[CALL2]]
100
- ; CHECK-NEXT: ret i16 [[ADD]]
119
+ ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@vararg_tests
120
+ ; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) {
121
+ ; NOT_CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i16 bitcast (i16 (i16, i16, ...)* @vararg_no_prop to i16 (i16)*)(i16 noundef 7)
122
+ ; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add i16 7, [[CALL2]]
123
+ ; NOT_CGSCC_NPM-NEXT: ret i16 [[ADD]]
124
+ ;
125
+ ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone
126
+ ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vararg_tests
127
+ ; IS__CGSCC_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0]] {
128
+ ; IS__CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i16 bitcast (i16 (i16, i16, ...)* @vararg_no_prop to i16 (i16)*)(i16 noundef 7)
129
+ ; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add i16 7, [[CALL2]]
130
+ ; IS__CGSCC_NPM-NEXT: ret i16 [[ADD]]
101
131
;
102
132
%call1 = call i16 (i16 , ...) @vararg_prop (i16 7 , i16 8 , i16 %a )
103
133
%call2 = call i16 bitcast (i16 (i16 , i16 , ...) * @vararg_no_prop to i16 (i16 ) *) (i16 7 )
@@ -106,10 +136,15 @@ define dso_local i16 @vararg_tests(i16 %a) {
106
136
}
107
137
108
138
define internal i16 @vararg_prop (i16 %p1 , ...) {
109
- ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
110
- ; IS__CGSCC____-LABEL: define {{[^@]+}}@vararg_prop
111
- ; IS__CGSCC____-SAME: (i16 [[P1:%.*]], ...) #[[ATTR0]] {
112
- ; IS__CGSCC____-NEXT: ret i16 undef
139
+ ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
140
+ ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vararg_prop
141
+ ; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], ...) #[[ATTR0]] {
142
+ ; IS__CGSCC_OPM-NEXT: ret i16 undef
143
+ ;
144
+ ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
145
+ ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vararg_prop
146
+ ; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], ...) #[[ATTR1]] {
147
+ ; IS__CGSCC_NPM-NEXT: ret i16 undef
113
148
;
114
149
ret i16 %p1
115
150
}
@@ -120,16 +155,24 @@ define internal i16 @vararg_no_prop(i16 %p1, i16 %p2, ...) {
120
155
; IS__TUNIT____-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR0]] {
121
156
; IS__TUNIT____-NEXT: ret i16 7
122
157
;
123
- ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
124
- ; IS__CGSCC____-LABEL: define {{[^@]+}}@vararg_no_prop
125
- ; IS__CGSCC____-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR0]] {
126
- ; IS__CGSCC____-NEXT: ret i16 7
158
+ ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
159
+ ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vararg_no_prop
160
+ ; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR0]] {
161
+ ; IS__CGSCC_OPM-NEXT: ret i16 7
162
+ ;
163
+ ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
164
+ ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vararg_no_prop
165
+ ; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR1]] {
166
+ ; IS__CGSCC_NPM-NEXT: ret i16 7
127
167
;
128
168
ret i16 %p1
129
169
}
130
170
131
171
;.
132
172
; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn }
133
173
;.
134
- ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn }
174
+ ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn }
175
+ ;.
176
+ ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone }
177
+ ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
135
178
;.
0 commit comments