summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/linker/archive/bar.s15
-rw-r--r--test/linker/archive/bar_with_very_long_filename.s15
-rw-r--r--test/linker/archive/barlong.a21
-rw-r--r--test/linker/archive/baz.s15
-rw-r--r--test/linker/archive/foo.s18
-rw-r--r--test/linker/archive/foobar.a55
-rw-r--r--test/linker/bar.c2
-rw-r--r--test/linker/baz.c2
-rw-r--r--test/linker/foo.c3
-rw-r--r--test/linker/main.c10
-rw-r--r--test/linker/main.s34
11 files changed, 190 insertions, 0 deletions
diff --git a/test/linker/archive/bar.s b/test/linker/archive/bar.s
new file mode 100644
index 000000000..7c39347e0
--- /dev/null
+++ b/test/linker/archive/bar.s
@@ -0,0 +1,15 @@
+ .text
+ .file "src/work/binaryen/test/linker/archive/bar.c"
+ .section .text.bar,"ax",@progbits
+ .hidden bar
+ .globl bar
+ .type bar,@function
+bar: # @bar
+# BB#0: # %entry
+ return
+ .endfunc
+.Lfunc_end0:
+ .size bar, .Lfunc_end0-bar
+
+
+ .ident "clang version 3.9.0 (trunk 267883) (llvm/trunk 267901)"
diff --git a/test/linker/archive/bar_with_very_long_filename.s b/test/linker/archive/bar_with_very_long_filename.s
new file mode 100644
index 000000000..7c39347e0
--- /dev/null
+++ b/test/linker/archive/bar_with_very_long_filename.s
@@ -0,0 +1,15 @@
+ .text
+ .file "src/work/binaryen/test/linker/archive/bar.c"
+ .section .text.bar,"ax",@progbits
+ .hidden bar
+ .globl bar
+ .type bar,@function
+bar: # @bar
+# BB#0: # %entry
+ return
+ .endfunc
+.Lfunc_end0:
+ .size bar, .Lfunc_end0-bar
+
+
+ .ident "clang version 3.9.0 (trunk 267883) (llvm/trunk 267901)"
diff --git a/test/linker/archive/barlong.a b/test/linker/archive/barlong.a
new file mode 100644
index 000000000..67b33e223
--- /dev/null
+++ b/test/linker/archive/barlong.a
@@ -0,0 +1,21 @@
+!<arch>
+// 32 `
+bar_with_very_long_filename.s/
+
+/0 0 0 0 644 363 `
+ .text
+ .file "src/work/binaryen/test/linker/archive/bar.c"
+ .section .text.bar,"ax",@progbits
+ .hidden bar
+ .globl bar
+ .type bar,@function
+bar: # @bar
+# BB#0: # %entry
+ return
+ .endfunc
+.Lfunc_end0:
+ .size bar, .Lfunc_end0-bar
+
+
+ .ident "clang version 3.9.0 (trunk 267883) (llvm/trunk 267901)"
+
diff --git a/test/linker/archive/baz.s b/test/linker/archive/baz.s
new file mode 100644
index 000000000..340a5dc07
--- /dev/null
+++ b/test/linker/archive/baz.s
@@ -0,0 +1,15 @@
+ .text
+ .file "src/work/binaryen/test/linker/baz.c"
+ .section .text.baz,"ax",@progbits
+ .hidden baz
+ .globl baz
+ .type baz,@function
+baz: # @baz
+# BB#0: # %entry
+ return
+ .endfunc
+.Lfunc_end0:
+ .size baz, .Lfunc_end0-baz
+
+
+ .ident "clang version 3.9.0 (trunk 267883) (llvm/trunk 267901)"
diff --git a/test/linker/archive/foo.s b/test/linker/archive/foo.s
new file mode 100644
index 000000000..28a2ca13b
--- /dev/null
+++ b/test/linker/archive/foo.s
@@ -0,0 +1,18 @@
+ .text
+ .file "src/work/binaryen/test/linker/foo.c"
+ .section .text.foo,"ax",@progbits
+ .hidden foo
+ .globl foo
+ .type foo,@function
+foo: # @foo
+ .result i32
+ .local i32
+# BB#0: # %entry
+ i32.const $0=, 43
+ return $0
+ .endfunc
+.Lfunc_end0:
+ .size foo, .Lfunc_end0-foo
+
+
+ .ident "clang version 3.9.0 (trunk 267883) (llvm/trunk 267901)"
diff --git a/test/linker/archive/foobar.a b/test/linker/archive/foobar.a
new file mode 100644
index 000000000..6028e8ce5
--- /dev/null
+++ b/test/linker/archive/foobar.a
@@ -0,0 +1,55 @@
+!<arch>
+foo.s/ 0 0 0 644 407 `
+ .text
+ .file "src/work/binaryen/test/linker/foo.c"
+ .section .text.foo,"ax",@progbits
+ .hidden foo
+ .globl foo
+ .type foo,@function
+foo: # @foo
+ .result i32
+ .local i32
+# BB#0: # %entry
+ i32.const $0=, 43
+ return $0
+ .endfunc
+.Lfunc_end0:
+ .size foo, .Lfunc_end0-foo
+
+
+ .ident "clang version 3.9.0 (trunk 267883) (llvm/trunk 267901)"
+
+bar.s/ 0 0 0 644 363 `
+ .text
+ .file "src/work/binaryen/test/linker/archive/bar.c"
+ .section .text.bar,"ax",@progbits
+ .hidden bar
+ .globl bar
+ .type bar,@function
+bar: # @bar
+# BB#0: # %entry
+ return
+ .endfunc
+.Lfunc_end0:
+ .size bar, .Lfunc_end0-bar
+
+
+ .ident "clang version 3.9.0 (trunk 267883) (llvm/trunk 267901)"
+
+baz.s/ 0 0 0 644 355 `
+ .text
+ .file "src/work/binaryen/test/linker/baz.c"
+ .section .text.baz,"ax",@progbits
+ .hidden baz
+ .globl baz
+ .type baz,@function
+baz: # @baz
+# BB#0: # %entry
+ return
+ .endfunc
+.Lfunc_end0:
+ .size baz, .Lfunc_end0-baz
+
+
+ .ident "clang version 3.9.0 (trunk 267883) (llvm/trunk 267901)"
+
diff --git a/test/linker/bar.c b/test/linker/bar.c
new file mode 100644
index 000000000..0476ca2b0
--- /dev/null
+++ b/test/linker/bar.c
@@ -0,0 +1,2 @@
+void bar() {
+}
diff --git a/test/linker/baz.c b/test/linker/baz.c
new file mode 100644
index 000000000..02759782d
--- /dev/null
+++ b/test/linker/baz.c
@@ -0,0 +1,2 @@
+void baz() {
+}
diff --git a/test/linker/foo.c b/test/linker/foo.c
new file mode 100644
index 000000000..187032ae2
--- /dev/null
+++ b/test/linker/foo.c
@@ -0,0 +1,3 @@
+int foo() {
+ return 43;
+}
diff --git a/test/linker/main.c b/test/linker/main.c
new file mode 100644
index 000000000..d70bc7033
--- /dev/null
+++ b/test/linker/main.c
@@ -0,0 +1,10 @@
+int foo() {
+ return 42;
+}
+
+void bar();
+
+int main() {
+ foo();
+ bar();
+}
diff --git a/test/linker/main.s b/test/linker/main.s
new file mode 100644
index 000000000..3dd310973
--- /dev/null
+++ b/test/linker/main.s
@@ -0,0 +1,34 @@
+ .text
+ .file "src/work/binaryen/test/linker/main.c"
+ .section .text.foo,"ax",@progbits
+ .hidden foo
+ .globl foo
+ .type foo,@function
+foo: # @foo
+ .result i32
+ .local i32
+# BB#0: # %entry
+ i32.const $0=, 42
+ return $0
+ .endfunc
+.Lfunc_end0:
+ .size foo, .Lfunc_end0-foo
+
+ .section .text.main,"ax",@progbits
+ .hidden main
+ .globl main
+ .type main,@function
+main: # @main
+ .result i32
+ .local i32
+# BB#0: # %entry
+ i32.call $discard=, foo@FUNCTION
+ call bar@FUNCTION
+ i32.const $0=, 0
+ return $0
+ .endfunc
+.Lfunc_end1:
+ .size main, .Lfunc_end1-main
+
+
+ .ident "clang version 3.9.0 (trunk 267883) (llvm/trunk 267901)"