~mcf/cproc

ref: 34ae0d48e9669687003c26f94e07fa00d12dd41f cproc/test/bitfield-assignment-sign-extend.qbe -rw-r--r-- 340 bytes
34ae0d48Michael Forney Add tests for char/wchar_t signedness 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
export
function w $main() {
@start.1
@body.2
	%.1 =l mul 0, 1
	%.2 =l add $s, %.1
	%.3 =w shl 15, 0
	%.4 =w shl %.3, 28
	%.5 =w sar %.4, 28
	%.6 =w and %.3, 15
	%.7 =w loadw %.2
	%.8 =w and %.7, 18446744073709551600
	%.9 =w or %.6, %.8
	storew %.9, %.2
	%.10 =w sub 0, 1
	%.11 =w cnew %.5, %.10
	ret %.11
}
export data $s = align 4 { z 4 }