-; RUN: opt -opaque-pointers=0 -S -wasm-add-missing-prototypes -o %t.ll %s 2>&1 | FileCheck %s -check-prefix=WARNING
+; RUN: opt -S -wasm-add-missing-prototypes -o %t.ll %s 2>&1 | FileCheck %s -check-prefix=WARNING
; RUN: cat %t.ll | FileCheck %s
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
; WARNING: warning: prototype-less function used with conflicting signatures: foo
; CHECK-LABEL: @call_with_conflicting_prototypes
-; CHECK: %call1 = call i64 bitcast (i64 (i32, i32)* @foo to i64 (i32)*)(i32 42)
+; CHECK: %call1 = call i64 @foo(i32 42)
; CHECK: %call2 = call i64 @foo(i32 42, i32 43)
define void @call_with_conflicting_prototypes() {
- %call1 = call i64 bitcast (i64 (...)* @foo to i64 (i32)*)(i32 42)
- %call2 = call i64 bitcast (i64 (...)* @foo to i64 (i32, i32)*)(i32 42, i32 43)
+ %call1 = call i64 @foo(i32 42)
+ %call2 = call i64 @foo(i32 42, i32 43)
ret void
}
-; CHECK: declare extern_weak i64 @foo(i32, i32)
+; CHECK: declare extern_weak i64 @foo(i32)
declare extern_weak i64 @foo(...) #1
; CHECK-NOT: attributes {{.*}} = { {{.*}}"no-prototype"{{.*}} }
-; RUN: opt -opaque-pointers=0 < %s -wasm-lower-em-ehsjlj -enable-emscripten-sjlj -S | FileCheck %s
+; RUN: opt < %s -wasm-lower-em-ehsjlj -enable-emscripten-sjlj -S | FileCheck %s
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown"
; CHECK-LABEL: @setjmp_debug_info0
entry:
%buf = alloca [1 x %struct.__jmp_buf_tag], align 16, !dbg !4
- %arraydecay = getelementptr inbounds [1 x %struct.__jmp_buf_tag], [1 x %struct.__jmp_buf_tag]* %buf, i32 0, i32 0, !dbg !5
- %call = call i32 @setjmp(%struct.__jmp_buf_tag* %arraydecay) #0, !dbg !6
+ %arraydecay = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %buf, i32 0, i32 0, !dbg !5
+ %call = call i32 @setjmp(ptr %arraydecay) #0, !dbg !6
call void @foo(), !dbg !7
ret void, !dbg !8
; CHECK: entry:
- ; CHECK-NEXT: call i8* @malloc(i32 40), !dbg ![[DL0:.*]]
- ; CHECK-NEXT: bitcast {{.*}}, !dbg ![[DL0]]
+ ; CHECK-NEXT: call ptr @malloc(i32 40), !dbg ![[DL0:.*]]
; CHECK: entry.split:
; CHECK: alloca {{.*}}, !dbg ![[DL0]]
- ; CHECK: call i32* @saveSetjmp{{.*}}, !dbg ![[DL1:.*]]
+ ; CHECK: call ptr @saveSetjmp{{.*}}, !dbg ![[DL1:.*]]
; CHECK-NEXT: call i32 @getTempRet0{{.*}}, !dbg ![[DL1]]
; CHECK-NEXT: br {{.*}}, !dbg ![[DL2:.*]]
; CHECK: call {{.*}} void @__invoke_void{{.*}}, !dbg ![[DL2]]
; CHECK: entry.split.split.split:
- ; CHECK-NEXT: bitcast {{.*}}, !dbg ![[DL3:.*]]
- ; CHECK-NEXT: call void @free{{.*}}, !dbg ![[DL3]]
+ ; CHECK-NEXT: call void @free{{.*}}, !dbg ![[DL3:.*]]
; CHECK: if.then1:
; CHECK: call i32 @testSetjmp{{.*}}, !dbg ![[DL2]]
; CHECK-LABEL: @setjmp_debug_info1
entry:
%buf = alloca [1 x %struct.__jmp_buf_tag], align 16
- %arraydecay = getelementptr inbounds [1 x %struct.__jmp_buf_tag], [1 x %struct.__jmp_buf_tag]* %buf, i32 0, i32 0
- %call = call i32 @setjmp(%struct.__jmp_buf_tag* %arraydecay) #0
+ %arraydecay = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %buf, i32 0, i32 0
+ %call = call i32 @setjmp(ptr %arraydecay) #0
call void @foo()
ret void
- ; CHECK: call i8* @malloc(i32 40), !dbg ![[DL_DUMMY:.*]]
+ ; CHECK: call ptr @malloc(i32 40), !dbg ![[DL_DUMMY:.*]]
; CHECK: call void @free{{.*}}, !dbg ![[DL_DUMMY]]
}
; Note that these functions have DISubprograms.
-declare !dbg !10 i8* @malloc(i32)
-declare !dbg !11 void @free(i8*)
+declare !dbg !10 ptr @malloc(i32)
+declare !dbg !11 void @free(ptr)
declare void @foo()
; Function Attrs: returns_twice
-declare i32 @setjmp(%struct.__jmp_buf_tag*) #0
+declare i32 @setjmp(ptr) #0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!0}