xref: /llvm-project/llvm/test/CodeGen/WebAssembly/add-prototypes-conflict.ll (revision 1b16c70299481c10e500715c9ab538a307bc0bb0)
1; RUN: opt -S -wasm-add-missing-prototypes -o %t.ll %s 2>&1 | FileCheck %s -check-prefix=WARNING
2; RUN: cat %t.ll | FileCheck %s
3
4target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5target triple = "wasm32-unknown-unknown"
6
7; WARNING: warning: prototype-less function used with conflicting signatures: foo
8
9; CHECK-LABEL: @call_with_conflicting_prototypes
10; CHECK: %call1 = call i64 @foo(i32 42)
11; CHECK: %call2 = call i64 @foo(i32 42, i32 43)
12define void @call_with_conflicting_prototypes() {
13  %call1 = call i64 @foo(i32 42)
14  %call2 = call i64 @foo(i32 42, i32 43)
15  ret void
16}
17
18; CHECK: declare extern_weak i64 @foo(i32)
19declare extern_weak i64 @foo(...) #1
20
21; CHECK-NOT: attributes {{.*}} = { {{.*}}"no-prototype"{{.*}} }
22attributes #1 = { "no-prototype" }
23