+
+dnl AUTORECODE had a use-after-free error when TEMPORARY was in use.
+dnl Bug #32757.
+AT_SETUP([AUTORECODE with TEMPORARY])
+AT_DATA([autorecode.sps],
+ [data list /X 1-5(a) Y 7.
+begin data.
+lasdj 1
+asdfk 0
+asdfj 2
+asdfj 1
+asdfk 2
+asdfj 9
+lajks 9
+asdfk 0
+asdfk 1
+end data.
+
+temporary.
+select if y > 1.
+autorecode x y into A B/descend.
+list.
+])
+AT_CHECK([pspp -O format=csv autorecode.sps], [0],
+ [Table: Reading 1 record from INLINE.
+Variable,Record,Columns,Format
+X,1,1- 5,A5
+Y,1,7- 7,F1.0
+
+Table: Data List
+X,Y,A,B
+lasdj,1,. ,. @&t@
+asdfk,0,2.00,. @&t@
+asdfj,2,3.00,2.00
+asdfj,1,3.00,. @&t@
+asdfk,2,2.00,2.00
+asdfj,9,3.00,1.00
+lajks,9,1.00,1.00
+asdfk,0,2.00,. @&t@
+asdfk,1,2.00,. @&t@
+])
+AT_CLEANUP
+
+
+dnl For compatibility, make sure that /INTO (with leading slash) is accepted
+dnl (bug #48762)
+AT_SETUP([AUTORECODE with /INTO])
+AT_DATA([autorecode.sps],
+ [data list list notable /x .
+begin data.
+1
+8
+-901
+4
+1
+99
+8
+end data.
+
+autorecode x /into y.
+
+list.
+])
+AT_CHECK([pspp -O format=csv autorecode.sps], [0],
+[Table: Data List
+x,y
+1.00,2.00
+8.00,4.00
+-901.00,1.00
+4.00,3.00
+1.00,2.00
+99.00,5.00
+8.00,4.00
+])
+AT_CLEANUP