Skip to content

Commit

Permalink
[WebAssembly] Run varargs codegen test with non-emscripten triple
Browse files Browse the repository at this point in the history
This is a followup from D105749 to cover both triples in the case
where they differ.
  • Loading branch information
dschuff committed Jul 13, 2021
1 parent 24129fb commit d4e2693
Showing 1 changed file with 36 additions and 16 deletions.
52 changes: 36 additions & 16 deletions llvm/test/CodeGen/WebAssembly/varargs.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -verify-machineinstrs | FileCheck %s
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -verify-machineinstrs | FileCheck %s --check-prefix=CHECK --check-prefix=EMSCRIPTEN
; RUN: llc < %s -mtriple wasm32-unknown-unknown -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -verify-machineinstrs | FileCheck %s --check-prefix=CHECK --check-prefix=UNKNOWN

; Test varargs constructs.

Expand Down Expand Up @@ -165,21 +166,40 @@ define void @nonlegal_fixed(fp128 %x, ...) nounwind {
; Test that an fp128 argument is properly aligned and allocated
; within a vararg buffer.

; CHECK-LABEL: call_fp128_alignment:
; CHECK: global.get $push5=, __stack_pointer
; CHECK-NEXT: i32.const $push6=, 32
; CHECK-NEXT: i32.sub $push10=, $pop5, $pop6
; CHECK-NEXT: local.tee $push9=, $1=, $pop10
; CHECK-NEXT: global.set __stack_pointer, $pop9
; CHECK-NEXT: i32.const $push0=, 16
; CHECK-NEXT: i32.add $push1=, $1, $pop0
; CHECK-NEXT: i64.const $push2=, -9223372036854775808
; CHECK-NEXT: i64.store 0($pop1), $pop2
; CHECK-NEXT: i64.const $push3=, 1
; CHECK-NEXT: i64.store 8($1), $pop3
; CHECK-NEXT: i32.const $push4=, 7
; CHECK-NEXT: i32.store 0($1), $pop4
; CHECK-NEXT: call callee, $1
; EMSCRIPTEN-LABEL: call_fp128_alignment:
; EMSCRIPTEN: global.get $push5=, __stack_pointer
; EMSCRIPTEN-NEXT: i32.const $push6=, 32
; EMSCRIPTEN-NEXT: i32.sub $push10=, $pop5, $pop6
; EMSCRIPTEN-NEXT: local.tee $push9=, $1=, $pop10
; EMSCRIPTEN-NEXT: global.set __stack_pointer, $pop9
; EMSCRIPTEN-NEXT: i32.const $push0=, 16
; EMSCRIPTEN-NEXT: i32.add $push1=, $1, $pop0
; EMSCRIPTEN-NEXT: i64.const $push2=, -9223372036854775808
; EMSCRIPTEN-NEXT: i64.store 0($pop1), $pop2
; EMSCRIPTEN-NEXT: i64.const $push3=, 1
; EMSCRIPTEN-NEXT: i64.store 8($1), $pop3
; EMSCRIPTEN-NEXT: i32.const $push4=, 7
; EMSCRIPTEN-NEXT: i32.store 0($1), $pop4
; EMSCRIPTEN-NEXT: call callee, $1

; Alignment of fp128 is a current disagreement between emscripten and others.
; UNKNOWN-LABEL: call_fp128_alignment:
; UNKNOWN: global.get $push7=, __stack_pointer
; UNKNOWN-NEXT: i32.const $push8=, 32
; UNKNOWN-NEXT: i32.sub $push12=, $pop7, $pop8
; UNKNOWN-NEXT: local.tee $push11=, $1=, $pop12
; UNKNOWN-NEXT: global.set __stack_pointer, $pop11
; UNKNOWN-NEXT: i32.const $push0=, 24
; UNKNOWN-NEXT: i32.add $push1=, $1, $pop0
; UNKNOWN-NEXT: i64.const $push2=, -9223372036854775808
; UNKNOWN-NEXT: i64.store 0($pop1), $pop2
; UNKNOWN-NEXT: i32.const $push3=, 16
; UNKNOWN-NEXT: i32.add $push4=, $1, $pop3
; UNKNOWN-NEXT: i64.const $push5=, 1
; UNKNOWN-NEXT: i64.store 0($pop4), $pop5
; UNKNOWN-NEXT: i32.const $push6=, 7
; UNKNOWN-NEXT: i32.store 0($1), $pop6
; UNKNOWN-NEXT: call callee, $1
define void @call_fp128_alignment(i8* %p) {
entry:
call void (...) @callee(i8 7, fp128 0xL00000000000000018000000000000000)
Expand Down

0 comments on commit d4e2693

Please sign in to comment.