@@ -115,7 +115,7 @@ dim shared byref as T T73 = T72
115115static shared byref as T T74 = T73
116116
117117
118- '' UDT with static byref fields
118+ '' UDT2 with static byref fields
119119
120120type T1
121121 dim as integer F
@@ -129,9 +129,9 @@ type T2
129129 static byref as T1 R4
130130end type
131131
132- dim shared T2_Initializer as T1
132+ dim shared T1_Initializer as T1
133133
134- dim byref as T1 T2.R1 = T2_Initializer
134+ dim byref as T1 T2.R1 = T1_Initializer
135135dim byref as T1 T2.R2 = T2.R1
136136dim byref as T1 T2.R3 = T2.R2
137137dim byref as T1 T2.R4 = T2.R3
@@ -141,6 +141,11 @@ dim shared byref as T1 RT2 = T2.R2
141141dim shared byref as T1 RT3 = T2.R3
142142dim shared byref as T1 RT4 = T2.R4
143143
144+ static shared byref as T1 SRT1 = RT1
145+ static shared byref as T1 SRT2 = RT2
146+ static shared byref as T1 SRT3 = RT3
147+ static shared byref as T1 SRT4 = RT4
148+
144149
145150SUITE( fbc_tests.dim_.byref_init_from_byref )
146151
@@ -274,10 +279,10 @@ SUITE( fbc_tests.dim_.byref_init_from_byref )
274279 END_TEST
275280
276281 TEST( UDT_static_local_to_static_shared )
277- static byref as T b = T51
278- static byref as T c = T54
282+ static byref as T b = T71
283+ static byref as T c = T74
279284 dim byref as T d = c
280- CheckAddrs( T51 , b, c, d )
285+ CheckAddrs( T71 , b, c, d )
281286 END_TEST
282287
283288 '' -------- UDT2 -------------------
@@ -290,5 +295,47 @@ SUITE( fbc_tests.dim_.byref_init_from_byref )
290295 CheckAddrs( RT1, RT2, RT3, RT4 )
291296 END_TEST
292297
293-
298+ TEST( UDT2_static_to_shared )
299+ CheckAddrs( SRT1, SRT2, SRT3, SRT4 )
300+ END_TEST
301+
302+ TEST( UDT2_check_all )
303+ static byref as T1 a = T2.R1
304+ static byref as T1 b = RT1
305+ dim byref as T1 c = SRT1
306+ dim byref as T1 d = c
307+ CheckAddrs( T2.R1, RT1, SRT1, a )
308+ CheckAddrs( T2.R2, RT2, SRT2, b )
309+ CheckAddrs( T2.R3, RT3, SRT3, c )
310+ CheckAddrs( T2.R4, RT4, SRT4, d )
311+ END_TEST
312+
313+ TEST( UDT2_local_to_shared )
314+ static byref as T1 b = RT1
315+ dim byref as T1 c = RT4
316+ dim byref as T1 d = c
317+ CheckAddrs( RT1, b, c, d )
318+ END_TEST
319+
320+ TEST( UDT2_local_to_static_shared )
321+ static byref as T1 b = SRT1
322+ dim byref as T1 c = SRT4
323+ dim byref as T1 d = c
324+ CheckAddrs( SRT1, b, c, d )
325+ END_TEST
326+
327+ TEST( UDT2_static_local_to_shared )
328+ static byref as T1 b = RT1
329+ static byref as T1 c = RT4
330+ dim byref as T1 d = c
331+ CheckAddrs( RT1, b, c, d )
332+ END_TEST
333+
334+ TEST( UDT2_static_local_to_static_shared )
335+ static byref as T1 b = SRT1
336+ static byref as T1 c = SRT4
337+ dim byref as T1 d = c
338+ CheckAddrs( SRT1, b, c, d )
339+ END_TEST
340+
294341END_SUITE
0 commit comments