-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebAssembly] Check signatures of weakly defined funtions too
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D43492 llvm-svn: 325598
- Loading branch information
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
target triple = "wasm32-unknown-unknown-wasm" | ||
|
||
define i64 @weakFn() #0 { | ||
entry: | ||
ret i64 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
; RUN: llc -filetype=obj %p/Inputs/weak-symbol1.ll -o %t.weak.o | ||
; RUN: llc -filetype=obj %p/Inputs/strong-symbol.ll -o %t.strong.o | ||
; RUN: llc -filetype=obj %s -o %t.o | ||
; RUN: not wasm-ld --check-signatures -o %t.wasm %t.o %t.strong.o %t.weak.o 2>&1 | FileCheck %s | ||
; RUN: wasm-ld -o %t.wasm %t.o %t.strong.o %t.weak.o | ||
|
||
target triple = "wasm32-unknown-unknown-wasm" | ||
|
||
declare i32 @weakFn() local_unnamed_addr | ||
|
||
define void @_start() local_unnamed_addr { | ||
entry: | ||
%call = call i32 @weakFn() | ||
ret void | ||
} | ||
|
||
; CHECK: error: function signature mismatch: weakFn | ||
; CHECK-NEXT: >>> defined as () -> I32 in {{.*}}signature-mismatch-weak.ll.tmp.o | ||
; CHECK-NEXT: >>> defined as () -> I64 in {{.*}}signature-mismatch-weak.ll.tmp.strong.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters