Skip to content

Commit 7f82551

Browse files
committed
Add multiple-float-constant codegen test
1 parent 1953171 commit 7f82551

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# run: codegen
2+
3+
func @fconst_multiple:f64(f64) {
4+
# check: function `fconst_multiple`:
5+
# nextln: 000000: 55 push rbp
6+
# nextln: 000001: 48 89 e5 mov rbp, rsp
7+
# nextln: 000004: f2 0f 10 0d 00 00 00 00 movsd xmm1, qword ptr [rip] # RELOC_PC32 -> @<CP> + -4
8+
# nextln: 00000c: f2 0f 58 c1 addsd xmm0, xmm1
9+
# nextln: 000010: f2 0f 10 0d 00 00 00 00 movsd xmm1, qword ptr [rip] # RELOC_PC32 -> @<CP> + 4
10+
# nextln: 000018: f2 0f 59 c1 mulsd xmm0, xmm1
11+
# nextln: 00001c: 5d pop rbp
12+
# nextln: 00001d: c3 ret
13+
# nextln: <CP>:
14+
# nextln: 000000: 00 00 00 00 00 00 14 40
15+
# nextln: 000008: 00 00 00 00 00 00 1c 40
16+
17+
%0:ctrl, %1:f64 = entry
18+
%2:f64 = fconst64 0x5
19+
%3:f64 = fconst64 0x7
20+
%4:f64 = fadd %1, %2
21+
%5:f64 = fmul %4, %3
22+
return %0, %5
23+
}

0 commit comments

Comments
 (0)