llvm.org GIT mirror llvm / 8d1235f
[WebAsembly] Update default triple in test files to wasm32-unknown-unkown. Summary: The final -wasm component has been the default for some time now. Subscribers: jfb, dschuff, jgravelle-google, eraman, aheejin, JDevlieghere, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D46342 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332007 91177308-0d34-0410-b5e6-96231b3b80d8 Sam Clegg 2 years ago
116 changed file(s) with 121 addition(s) and 121 deletion(s). Raw diff Collapse all Expand all
33 ; a variety of circumstances.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 @g = external global [0 x i32], align 4
99
11 ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -verify-machineinstrs -fast-isel | FileCheck %s
22
33 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4 target triple = "wasm32-unknown-unknown-wasm"
4 target triple = "wasm32-unknown-unknown"
55
66 %SmallStruct = type { i32 }
77 %OddStruct = type { i32, i8, i32 }
33 ; Test that basic call operations assemble as expected.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 declare i32 @i32_nullary()
99 declare i32 @i32_unary(i32)
66 ; optnone test.
77
88 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
9 target triple = "wasm32-unknown-unknown-wasm"
9 target triple = "wasm32-unknown-unknown"
1010
1111 declare void @something()
1212
22 ; Tests that we correctly assign indexes for control flow integrity.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 @0 = private unnamed_addr constant [2 x void (...)*] [void (...)* bitcast (void ()* @f to void (...)*), void (...)* bitcast (void ()* @g to void (...)*)], align 16
88
33 ; expected.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; CHECK-LABEL: ord_f32:
99 ; CHECK-NEXT: .param f32, f32{{$}}
33 ; expected.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; CHECK-LABEL: ord_f64:
99 ; CHECK-NEXT: .param f64, f64{{$}}
33 ; Test that basic 32-bit integer comparison operations assemble as expected.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; CHECK-LABEL: eq_i32:
99 ; CHECK-NEXT: .param i32, i32{{$}}
33 ; Test that basic 64-bit integer comparison operations assemble as expected.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; CHECK-LABEL: eq_i64:
99 ; CHECK-NEXT: .param i64, i64{{$}}
33 ; the trapping opcodes and explicit code to suppress the trapping.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; CHECK-LABEL: i32_trunc_s_f32:
99 ; CHECK-NEXT: .param f32{{$}}
22 ; Test that basic conversion operations assemble as expected.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: i32_wrap_i64:
88 ; CHECK-NEXT: .param i64{{$}}
33 ; unfolded.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 declare double @copysign(double, double) nounwind readnone
99 declare float @copysignf(float, float) nounwind readnone
0 ; This tests that llc accepts all valid WebAssembly CPUs.
11
2 ; RUN: llc < %s -asm-verbose=false -mtriple=wasm32-unknown-unknown-wasm -mcpu=mvp 2>&1 | FileCheck %s
2 ; RUN: llc < %s -asm-verbose=false -mtriple=wasm32-unknown-unknown -mcpu=mvp 2>&1 | FileCheck %s
33 ; RUN: llc < %s -asm-verbose=false -mtriple=wasm64-unknown-unknown-wasm -mcpu=mvp 2>&1 | FileCheck %s
4 ; RUN: llc < %s -asm-verbose=false -mtriple=wasm32-unknown-unknown-wasm -mcpu=generic 2>&1 | FileCheck %s
4 ; RUN: llc < %s -asm-verbose=false -mtriple=wasm32-unknown-unknown -mcpu=generic 2>&1 | FileCheck %s
55 ; RUN: llc < %s -asm-verbose=false -mtriple=wasm64-unknown-unknown-wasm -mcpu=generic 2>&1 | FileCheck %s
6 ; RUN: llc < %s -asm-verbose=false -mtriple=wasm32-unknown-unknown-wasm -mcpu=bleeding-edge 2>&1 | FileCheck %s
6 ; RUN: llc < %s -asm-verbose=false -mtriple=wasm32-unknown-unknown -mcpu=bleeding-edge 2>&1 | FileCheck %s
77 ; RUN: llc < %s -asm-verbose=false -mtriple=wasm64-unknown-unknown-wasm -mcpu=bleeding-edge 2>&1 | FileCheck %s
8 ; RUN: llc < %s -asm-verbose=false -mtriple=wasm32-unknown-unknown-wasm -mcpu=invalidcpu 2>&1 | FileCheck %s --check-prefix=INVALID
8 ; RUN: llc < %s -asm-verbose=false -mtriple=wasm32-unknown-unknown -mcpu=invalidcpu 2>&1 | FileCheck %s --check-prefix=INVALID
99 ; RUN: llc < %s -asm-verbose=false -mtriple=wasm64-unknown-unknown-wasm -mcpu=invalidcpu 2>&1 | FileCheck %s --check-prefix=INVALID
1010
1111 ; CHECK-NOT: is not a recognized processor for this target
22 ; Test the mechanism for defining user custom sections.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 !0 = !{ !"red", !"foo" }
88 !1 = !{ !"green", !"bar" }
55 ; CHECK: DW_TAG_variable
66 source_filename = "test/CodeGen/WebAssembly/dbgvalue.ll"
77 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
8 target triple = "wasm32-unknown-unknown-wasm"
8 target triple = "wasm32-unknown-unknown"
99
1010 @key = external local_unnamed_addr global [15 x i8], align 1
1111 @.str = external unnamed_addr constant [33 x i8], align 1
22 ; Check that unused vregs aren't assigned registers.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 define void @foo(i32* nocapture %a, i32 %w, i32 %h) {
88 ; CHECK-LABEL: foo:
22 ; Test that integer div and rem by constant are optimized appropriately.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: test_udiv_2:
88 ; CHECK: i32.shr_u
0 ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s
11
22 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
3 target triple = "wasm32-unknown-unknown-wasm"
3 target triple = "wasm32-unknown-unknown"
44
55 declare void @llvm.wasm.throw(i32, i8*)
66 declare void @llvm.wasm.rethrow()
33 ; Test that f16 is expanded.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; CHECK-LABEL: demote:
99 ; CHECK-NEXT: .param f32{{$}}
22 ; Test that basic 32-bit floating-point operations assemble as expected.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 declare float @llvm.fabs.f32(float)
88 declare float @llvm.copysign.f32(float, float)
22 ; Test that basic 64-bit floating-point operations assemble as expected.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 declare double @llvm.fabs.f64(double)
88 declare double @llvm.copysign.f64(double, double)
33 ; Test that fast-isel properly copes with i24 arguments and return types.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 define i24 @add(i24 %x, i24 %y) {
99 %z = add i24 %x, %y
33 ; Test that FastISel does not generate instructions with NoReg
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; CHECK: i32.const $push0=, 0
99 define hidden i32 @a() #0 {
33 ; RUN: | FileCheck %s
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; This tests very minimal fast-isel functionality.
99
22 ; Test that the frem instruction works.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: frem32:
88 ; CHECK-NEXT: .param f32, f32{{$}}
22 ; Test that basic functions assemble as expected.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: f0:
88 ; CHECK: return{{$}}
33 ; wrappers.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 define void @callWithArgs() {
99 entry:
22 ; Test that function pointer casts are replaced with wrappers.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 declare void @has_i32_arg(i32)
88 declare i32 @has_i32_ret()
22 ; Test that globals assemble as expected.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-NOT: llvm.used
88 ; CHECK-NOT: llvm.metadata
0 ; RUN: llc < %s -asm-verbose=false | FileCheck %s
11
22 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
3 target triple = "wasm32-unknown-unknown-wasm"
3 target triple = "wasm32-unknown-unknown"
44
55 ; CHECK: .globl foo
66 ; CHECK: .type foo,@function
33 ; PR36128
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 declare i128 @bar(i128 returned)
99
22 ; Test that basic 128-bit integer operations assemble as expected.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 declare i128 @llvm.ctlz.i128(i128, i1)
88 declare i128 @llvm.cttz.i128(i128, i1)
22 ; Test loads and stores with custom alignment values.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: ldi32_a1:
88 ; CHECK-NEXT: .param i32{{$}}
22 ; Test that basic 32-bit integer operations assemble as expected.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 declare i32 @llvm.ctlz.i32(i32, i1)
88 declare i32 @llvm.cttz.i32(i32, i1)
22 ; Test loads and stores with custom alignment values.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: ldi64_a1:
88 ; CHECK-NEXT: .param i32{{$}}
22 ; Test that basic 64-bit integer operations assemble as expected.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 declare i64 @llvm.ctlz.i64(i64, i1)
88 declare i64 @llvm.cttz.i64(i64, i1)
22 ; Test llvm.ident.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK: .ident "hello world"
88
22 ; Test that basic immediates assemble as expected.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: zero_i32:
88 ; CHECK-NEXT: .result i32{{$}}
0 ; RUN: llc -o - %s -asm-verbose=false | FileCheck %s
11 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 ; Test that stackified IMPLICIT_DEF instructions are converted into
55 ; CONST_I32 to provide an explicit push.
0 ; RUN: llc < %s -asm-verbose=false | FileCheck %s
11
22 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
3 target triple = "wasm32-unknown-unknown-wasm"
3 target triple = "wasm32-unknown-unknown"
44
55 define void @test() {
66 call void @foo()
33 ; -no-integrated-as since these aren't actually valid assembly syntax.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 define void @bar(i32* %r, i32* %s) {
99 entry:
33 ; actually valid assembly syntax.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; CHECK-LABEL: foo:
99 ; CHECK-NEXT: .param i32{{$}}
22 ; Test irreducible CFG handling.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; A simple loop with two entries.
88
22 ; Test various types and operators that need to be legalized.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: shl_i3:
88 ; CHECK: i32.const $push0=, 7{{$}}
22 ; Test a subset of compiler-rt/libm libcalls expected to be emitted by the wasm backend
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 declare fp128 @llvm.sqrt.f128(fp128)
88 declare fp128 @llvm.floor.f128(fp128)
22 ; Test that extending loads are assembled properly.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: sext_i8_i32:
88 ; CHECK: i32.atomic.load8_u $push0=, 0($0){{$}}
22 ; Test that extending loads are assembled properly.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: sext_i8_i32:
88 ; CHECK: i32.load8_s $push0=, 0($0){{$}}
22 ; Test that i1 extending loads and truncating stores are assembled properly.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: load_u_i1_i32:
88 ; CHECK: i32.load8_u $push[[NUM0:[0-9]+]]=, 0($0){{$}}
33 ; Test that basic loads are assembled properly.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; CHECK-LABEL: ldi32:
99 ; CHECK-NEXT: .param i32{{$}}
22 ; RUN: llc < %s | FileCheck %s --check-prefix=NONE
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 %struct.__jmp_buf_tag = type { [6 x i32], i32, [32 x i32] }
88
0 ; RUN: opt < %s -wasm-lower-em-ehsjlj -emscripten-cxx-exceptions-whitelist=do_catch -S | FileCheck %s
11
22 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
3 target triple = "wasm32-unknown-unknown-wasm"
3 target triple = "wasm32-unknown-unknown"
44
55 define void @dont_catch() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
66 ; CHECK-LABEL: @dont_catch(
0 ; RUN: opt < %s -wasm-lower-em-ehsjlj -S | FileCheck %s
11
22 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
3 target triple = "wasm32-unknown-unknown-wasm"
3 target triple = "wasm32-unknown-unknown"
44
55 @_ZTIi = external constant i8*
66 @_ZTIc = external constant i8*
0 ; RUN: opt < %s -wasm-lower-em-ehsjlj -S | FileCheck %s
11
22 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
3 target triple = "wasm32-unknown-unknown-wasm"
3 target triple = "wasm32-unknown-unknown"
44
55 %struct.__jmp_buf_tag = type { [6 x i32], i32, [32 x i32] }
66
0 ; RUN: llc < %s -asm-verbose=false | FileCheck --check-prefix=CHECK --check-prefix=FINI --check-prefix=NULL %s
11
22 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
3 target triple = "wasm32-unknown-unknown-wasm"
3 target triple = "wasm32-unknown-unknown"
44
55 ; Test that @llvm.global_dtors is properly lowered into @llvm.global_ctors,
66 ; grouping dtor calls by priority and associated symbol.
22 ; Test main functions with alternate signatures.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 declare void @main()
88
22 ; Test main functions with alternate signatures.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 define void @main() {
88 ret void
22 ; Test memcpy, memmove, and memset intrinsics.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1)
88 declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1)
22 ; Test that basic memory operations assemble as expected with 32-bit addresses.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 declare i32 @llvm.wasm.mem.size.i32(i32) nounwind readonly
88 declare i32 @llvm.wasm.mem.grow.i32(i32, i32) nounwind
33 ; because wasm's stack is always non-executable.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; CHECK-NOT: .note.GNU-stack
33 ; Test that atomic loads are assembled properly.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; CHECK-LABEL: load_i32_no_offset:
99 ; CHECK: i32.atomic.load $push[[NUM:[0-9]+]]=, 0($0){{$}}
22 ; Test that constant offsets can be folded into global addresses.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 @x = external global [0 x i32]
88 @y = global [50 x i32] zeroinitializer
22 ; Test constant load and store address offsets.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; With an nuw add, we can fold an offset.
88
22 ; Test that phis are lowered.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; Basic phi triangle.
88
22 ; Test the register stackifier pass.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; No because of pointer aliasing.
88
11 ; RUN: llc < %s -asm-verbose=false -fast-isel -fast-isel-abort=1 | FileCheck %s
22
33 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4 target triple = "wasm32-unknown-unknown-wasm"
4 target triple = "wasm32-unknown-unknown"
55
66 ; CHECK-LABEL: return_i32:
77 ; CHECK-NEXT: .param i32{{$}}
11 ; RUN: llc < %s -asm-verbose=false -fast-isel -fast-isel-abort=1 | FileCheck %s
22
33 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4 target triple = "wasm32-unknown-unknown-wasm"
4 target triple = "wasm32-unknown-unknown"
55
66 ; CHECK-LABEL: return_void:
77 ; CHECK-NEXT: end_function{{$}}
22 ; Test that the "returned" attribute is optimized effectively.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: _Z3foov:
88 ; CHECK-NEXT: .result i32{{$}}
33 ; Test that wasm select instruction is selected from LLVM select instruction.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; CHECK-LABEL: select_i32_bool:
99 ; CHECK-NEXT: .param i32, i32, i32{{$}}
11 ; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals | FileCheck %s
22
33 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4 target triple = "wasm32-unknown-unknown-wasm"
4 target triple = "wasm32-unknown-unknown"
55
66 declare i32 @get_int(i16 %arg)
77
11 ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s --check-prefix=NOSIGNEXT
22
33 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4 target triple = "wasm32-unknown-unknown-wasm"
4 target triple = "wasm32-unknown-unknown"
55
66 ; CHECK-LABEL: i32_extend8_s:
77 ; CHECK-NEXT: .param i32{{$}}
22 ; Test zeroext and signext ABI keywords
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: z2s_func:
88 ; CHECK-NEXT: .param i32{{$}}
55 ; Test that basic SIMD128 arithmetic operations assemble as expected.
66
77 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
8 target triple = "wasm32-unknown-unknown-wasm"
8 target triple = "wasm32-unknown-unknown"
99
1010 declare i32 @llvm.ctlz.i32(i32, i1)
1111 declare i32 @llvm.cttz.i32(i32, i1)
0 ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s
11
22 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
3 target triple = "wasm32-unknown-unknown-wasm"
3 target triple = "wasm32-unknown-unknown"
44
55 declare void @somefunc(i32*)
66
22 ; Test that truncating stores are assembled properly.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: trunc_i8_i32:
88 ; CHECK: i32.store8 0($0), $1{{$}}
33 ; Test that basic stores are assembled properly.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 ; CHECK-LABEL: sti32:
99 ; CHECK-NEXT: .param i32, i32{{$}}
33 ; the blocks in a way that isn't interesting here.
44
55 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown-wasm"
6 target triple = "wasm32-unknown-unknown"
77
88 declare void @foo0()
99 declare void @foo1()
0 ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -thread-model=single | FileCheck --check-prefix=SINGLE %s
11 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 ; SINGLE-LABEL: address_of_tls:
55 define i32 @address_of_tls() {
0 ; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals | FileCheck %s
11 ; Test that UMULO works correctly on 64-bit operands.
22 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
3 target triple = "wasm32-unknown-unknown-wasm"
3 target triple = "wasm32-unknown-unknown"
44
55 ; CHECK-LABEL: _ZN4core3num21_$LT$impl$u20$u64$GT$15overflowing_mul17h07be88b4cbac028fE:
66 ; CHECK: __multi3
44 ; wasm unreachable
55
66 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
7 target triple = "wasm32-unknown-unknown-wasm"
7 target triple = "wasm32-unknown-unknown"
88
99 declare void @llvm.trap()
1010 declare void @llvm.debugtrap()
44 ; conversions are implemented.
55
66 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
7 target triple = "wasm32-unknown-unknown-wasm"
7 target triple = "wasm32-unknown-unknown"
88
99 ; CHECK-LABEL: test:
1010 ; CHECK-NEXT: i32.const $push[[L0:[0-9]+]]=, 0{{$}}
22 ; Make sure that argument offsets are correct even if some arguments are unused.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; CHECK-LABEL: unused_first:
88 ; CHECK-NEXT: .param i32, i32{{$}}
0 ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s
11
22 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
3 target triple = "wasm32-unknown-unknown-wasm"
3 target triple = "wasm32-unknown-unknown"
44
55 declare void @ext_func(i64* %ptr)
66 declare void @ext_func_i32(i32* %ptr)
22 ; Test varargs constructs.
33
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 ; Test va_start.
88
1111 ; Each with a virtual dtor and method foo.
1212
1313 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
14 target triple = "wasm32-unknown-unknown-wasm"
14 target triple = "wasm32-unknown-unknown"
1515
1616 %struct.A = type { i32 (...)** }
1717 %struct.B = type { %struct.A }
None ; RUN: llc < %s -verify-machineinstrs -mtriple=wasm32-unknown-unknown-wasm | FileCheck %s
1 ; RUN: llc < %s -verify-machineinstrs -mtriple=wasm32-unknown-unknown-wasm -fast-isel | FileCheck --check-prefix=CHECK-FAST %s
0 ; RUN: llc < %s -verify-machineinstrs -mtriple=wasm32-unknown-unknown | FileCheck %s
1 ; RUN: llc < %s -verify-machineinstrs -mtriple=wasm32-unknown-unknown -fast-isel | FileCheck --check-prefix=CHECK-FAST %s
22
33 ; CHECK: DW_TAG_variable
44 ; CHECK-FAST: DW_TAG_variable
77
88 source_filename = "test/DebugInfo/WebAssembly/dbg-declare.ll"
99 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
10 target triple = "wasm32-unknown-unknown-wasm"
10 target triple = "wasm32-unknown-unknown"
1111
1212 @key = external global [15 x i8], align 1
1313
1414 ; ModuleID = 'dbg-loop-loc.bc'
1515 source_filename = "dbg-loop-loc.c"
1616 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
17 target triple = "wasm32-unknown-unknown-wasm"
17 target triple = "wasm32-unknown-unknown"
1818
1919 ; CHECK: .file 1
2020 ; CHECK: .loc 1 1 0
22
33 source_filename = "ws.c"
44 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown-wasm"
5 target triple = "wasm32-unknown-unknown"
66
77 %struct.bd = type { i8 }
88
0 # RUN: llvm-mc -triple=wasm32-unknown-unknown-elf < %s | FileCheck %s
1 # RUN: llvm-mc -triple=wasm32-unknown-unknown-wasm < %s | FileCheck %s
1 # RUN: llvm-mc -triple=wasm32-unknown-unknown < %s | FileCheck %s
22
33 .text
44 .type test0,@function
11 ; in wasm relocations.
22 ; RUN: not llc -filetype=obj %s -o /dev/null 2>&1 | FileCheck %s
33
4 target triple = "wasm32-unknown-unknown-wasm"
4 target triple = "wasm32-unknown-unknown"
55
66 @foo = internal global i8* blockaddress(@bar, %addr), align 4
77
0 ; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 @g0 = global i8* null, align 4
55 @g1 = global i32 0, align 4
0 ; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 ; Import a function just so we can check the index arithmetic for
55 ; WASM_COMDAT_FUNCTION entries is performed correctly
0 ; RUN: llc -O2 -filetype=obj %s -o %t.o
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 ; Wasm silently ignores custom sections for code.
55 ; We had a bug where this cause a crash
11
22 ; Test the mechanism for defining user custom sections.
33
4 target triple = "wasm32-unknown-unknown-wasm"
4 target triple = "wasm32-unknown-unknown"
55
66 !0 = !{ !"red", !"foo" }
77 !1 = !{ !"green", !"bar" }
203203 ; CHECK-NEXT: }
204204 ; CHECK-NEXT:]
205205
206 target triple = "wasm32-unknown-unknown-wasm"
206 target triple = "wasm32-unknown-unknown"
207207
208208 source_filename = "test.c"
209209
5353
5454 ; CHECK: 0x00000069: NULL
5555
56 target triple = "wasm32-unknown-unknown-wasm"
56 target triple = "wasm32-unknown-unknown"
5757
5858 source_filename = "test.c"
5959
0 ; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 %struct.bd = type { i32, i8 }
55
0 ; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 ; Verify relocations are correctly generated for addresses of externals
55 ; in the data section.
0 ; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 ; Verify that addresses of external functions generate correctly typed
55 ; imports and relocations or type R_TABLE_INDEX_I32.
0 ; RUN: llc -filetype=obj %s -o - | llvm-readobj -file-headers | FileCheck %s
11
22 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
3 target triple = "wasm32-unknown-unknown-wasm"
3 target triple = "wasm32-unknown-unknown"
44
55 ; CHECK: Format: WASM{{$}}
66 ; CHECK: Arch: wasm32{{$}}
0 ; RUN: llc -O2 -filetype=obj %s -o - | llvm-readobj -r -s -expand-relocs | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 declare i32 @import1()
55 declare i32 @import2()
0 ; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 @global1 = global i32 1025, align 8
55
0 ; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 define hidden void @call_memcpy(i8* align 4 %a, i8* align 4 %b) {
55 entry:
0 ; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 ; CHECK: - Type: CODE
55 ; CHECK-NEXT: Functions:
0 ; RUN: llc -filetype=obj %s -o - | llvm-readobj -r -expand-relocs | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 ; Pointers to functions of two different types
55 @a = global i64 ()* inttoptr (i64 5 to i64 ()*), align 8
0 ; RUN: llc -O0 -filetype=obj %s -o - | llvm-readobj -r -expand-relocs | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 ; foo and bar are external and internal symbols. a and b are pointers
55 ; initialized to these locations offset by 2 and -2 elements respecitively.
0 ; RUN: llc -filetype=obj %s -o - | llvm-readobj -s | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 ; external function
55 declare i32 @a()
0 ; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 ; Function that uses explict stack, and should generate a reference to
55 ; __stack_pointer, along with the corresponding reloction entry.
0 ; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 @.str1 = private unnamed_addr constant [6 x i8] c"hello\00", align 1
55 @.str2 = private unnamed_addr constant [6 x i8] c"world\00", align 1
0 ; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 ; Function with __attribute__((visibility("default")))
55 define void @defaultVis() #0 {
11 ; RUN: obj2yaml %t.o | FileCheck %s
22 ; RUN: llvm-objdump -t %t.o | FileCheck --check-prefix=CHECK-SYMS %s
33
4 target triple = "wasm32-unknown-unknown-wasm"
4 target triple = "wasm32-unknown-unknown"
55
66 ; 'foo_alias()' is weak alias of function 'foo()'
77 ; 'bar_alias' is weak alias of global variable 'bar'
0 ; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
11
2 target triple = "wasm32-unknown-unknown-wasm"
2 target triple = "wasm32-unknown-unknown"
33
44 ; Weak external data reference
55 @weak_external_data = extern_weak global i32, align 4
0 ; Input used for generating checked-in binaries (trivial-object-test.*)
1 ; llc -mtriple=wasm32-unknown-unknown-wasm trivial.ll -filetype=obj -o trivial-object-test.wasm
1 ; llc -mtriple=wasm32-unknown-unknown trivial.ll -filetype=obj -o trivial-object-test.wasm
22
33 @.str = private unnamed_addr constant [13 x i8] c"Hello World\0A\00", align 1
44
None ; RUN: llc -filetype=obj -mtriple=wasm32-unknown-unknown-wasm -o %t.o %s
0 ; RUN: llc -filetype=obj -mtriple=wasm32-unknown-unknown -o %t.o %s
11 ; RUN: llvm-nm %t.o | FileCheck %s
22
33 @foo = internal global i32 1, align 4
0 ; Input used for generating checked-in binaries (trivial.obj.*)
1 ; llc -mtriple=wasm32-unknown-unknown-wasm trivial.ll -filetype=obj -o trivial.obj.wasm
1 ; llc -mtriple=wasm32-unknown-unknown trivial.ll -filetype=obj -o trivial.obj.wasm
22
33 @.str = private unnamed_addr constant [13 x i8] c"Hello World\0A\00", align 1
44
None ; RUN: llc -mtriple=wasm32-unknown-unknown-wasm -filetype=obj %s -o - | llvm-objdump -r - | FileCheck %s
0 ; RUN: llc -mtriple=wasm32-unknown-unknown -filetype=obj %s -o - | llvm-objdump -r - | FileCheck %s
11
22 @foo = external global i32, align 4
33 @bar = global i32* @foo, align 4
44 ; llc -mtriple=x86_64-linux-gnu trivial.ll -filetype=obj -o trivial.obj.elf-x86-64 -relocation-model=pic
55 ; llc -mtriple=i386-apple-darwin10 trivial.ll -filetype=obj -o trivial.obj.macho-i386 -relocation-model=pic
66 ; llc -mtriple=x86_64-apple-darwin10 trivial.ll -filetype=obj -o trivial.obj.macho-x86-64 -relocation-model=pic
7 ; llc -mtriple=wasm32-unknown-unknown-wasm trivial.ll -filetype=obj -o trivial.obj.wasm
7 ; llc -mtriple=wasm32-unknown-unknown trivial.ll -filetype=obj -o trivial.obj.wasm
88
99 @.str = private unnamed_addr constant [13 x i8] c"Hello World\0A\00", align 1
1010