1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

[WebAssembly] MC: Use inline triple in test bitcode files

This matches the CodeGen tests and makes it a little easy
to run these from the command line manually.

Differential Revision: https://reviews.llvm.org/D42440

llvm-svn: 323275
This commit is contained in:
Sam Clegg 2018-01-23 23:03:47 +00:00
parent 2152a6d815
commit 4d3b657b4e
17 changed files with 54 additions and 18 deletions

View File

@ -1,4 +1,6 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | obj2yaml | FileCheck %s
; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
@g0 = global i8* null, align 4
@g1 = global i32 0, align 4

View File

@ -1,4 +1,6 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | obj2yaml | FileCheck %s
; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
; Import a function just so we can check the index arithmetic for
; WASM_COMDAT_FUNCTION entries is performed correctly

View File

@ -1,4 +1,6 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -O2 -filetype=obj %s -o %t.o
; RUN: llc -O2 -filetype=obj %s -o %t.o
target triple = "wasm32-unknown-unknown-wasm"
; Wasm silently ignores custom sections for code.
; We had a bug where this cause a crash

View File

@ -1,4 +1,6 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | llvm-readobj -r -s -expand-relocs
; RUN: llc -filetype=obj %s -o - | llvm-readobj -r -s -expand-relocs
target triple = "wasm32-unknown-unknown-wasm"
; Debug information is currently not supported. This test simply verifies that
; a valid object generated.

View File

@ -1,4 +1,6 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | obj2yaml | FileCheck %s
; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
%struct.bd = type { i32, i8 }

View File

@ -1,4 +1,7 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | obj2yaml | FileCheck %s
; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
; Verify relocations are correctly generated for addresses of externals
; in the data section.

View File

@ -1,4 +1,7 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | obj2yaml | FileCheck %s
; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
; Verify that addresses of external functions generate correctly typed
; imports and relocations or type R_TABLE_INDEX_I32.

View File

@ -1,4 +1,6 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -O2 -filetype=obj %s -o - | llvm-readobj -r -s -expand-relocs | FileCheck %s
; RUN: llc -O2 -filetype=obj %s -o - | llvm-readobj -r -s -expand-relocs | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
declare i32 @import1()
declare i32 @import2()

View File

@ -1,4 +1,6 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | obj2yaml | FileCheck %s
; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
@global1 = global i32 1025, align 8

View File

@ -1,4 +1,6 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | llvm-readobj -r -expand-relocs | FileCheck %s
; RUN: llc -filetype=obj %s -o - | llvm-readobj -r -expand-relocs | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
; Pointers to functions of two different types
@a = global i64 ()* inttoptr (i64 5 to i64 ()*), align 8

View File

@ -1,7 +1,10 @@
; RUN: llc -O0 -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | llvm-readobj -r -expand-relocs | FileCheck %s
; RUN: llc -O0 -filetype=obj %s -o - | llvm-readobj -r -expand-relocs | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
; foo and bar are external and internal symbols. a and b are pointers
; initialized to these locations offset by 2 and -2 elements respecitively.
@foo = external global i32, align 4
@bar = global i64 7, align 4
@a = global i32* getelementptr (i32, i32* @foo, i32 2), align 8

View File

@ -1,4 +1,6 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | llvm-readobj -s | FileCheck %s
; RUN: llc -filetype=obj %s -o - | llvm-readobj -s | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
; external function
declare i32 @a()
@ -13,7 +15,6 @@ entry:
ret i32 %tmp1
}
; CHECK: Format: WASM
; CHECK: Arch: wasm32
; CHECK: AddressSize: 32bit

View File

@ -1,4 +1,6 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | obj2yaml | FileCheck %s
; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
; Function that uses explict stack, and should generate a reference to
; __stack_pointer, along with the corresponding reloction entry.

View File

@ -1,4 +1,6 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | obj2yaml | FileCheck %s
; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
@.str1 = private unnamed_addr constant [6 x i8] c"hello\00", align 1
@.str2 = private unnamed_addr constant [6 x i8] c"world\00", align 1

View File

@ -1,4 +1,6 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | obj2yaml | FileCheck %s
; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
; Function with __attribute__((visibility("default")))
define void @defaultVis() #0 {

View File

@ -1,7 +1,9 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o %t.o
; RUN: llc -filetype=obj %s -o %t.o
; RUN: obj2yaml %t.o | FileCheck %s
; RUN: llvm-objdump -t %t.o | FileCheck --check-prefix=CHECK-SYMS %s
target triple = "wasm32-unknown-unknown-wasm"
; 'foo_alias()' is weak alias of function 'foo()'
; 'bar_alias' is weak alias of global variable 'bar'
; Generates two exports of the same function, one of them weak

View File

@ -1,4 +1,6 @@
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | obj2yaml | FileCheck %s
; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
; Weak external data reference
@weak_external_data = extern_weak global i32, align 4