From 1b16c70299481c10e500715c9ab538a307bc0bb0 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 4 Apr 2023 12:16:50 +0200 Subject: [PATCH] [WebAssembly] Convert tests to opaque pointers (NFC) --- .../CodeGen/WebAssembly/add-prototypes-conflict.ll | 10 ++++----- .../CodeGen/WebAssembly/lower-em-sjlj-debuginfo.ll | 26 ++++++++++------------ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/llvm/test/CodeGen/WebAssembly/add-prototypes-conflict.ll b/llvm/test/CodeGen/WebAssembly/add-prototypes-conflict.ll index e2a2ea1..4d394ee 100644 --- a/llvm/test/CodeGen/WebAssembly/add-prototypes-conflict.ll +++ b/llvm/test/CodeGen/WebAssembly/add-prototypes-conflict.ll @@ -1,4 +1,4 @@ -; 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" @@ -7,15 +7,15 @@ target triple = "wasm32-unknown-unknown" ; 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"{{.*}} } diff --git a/llvm/test/CodeGen/WebAssembly/lower-em-sjlj-debuginfo.ll b/llvm/test/CodeGen/WebAssembly/lower-em-sjlj-debuginfo.ll index 4830d44..4f69415 100644 --- a/llvm/test/CodeGen/WebAssembly/lower-em-sjlj-debuginfo.ll +++ b/llvm/test/CodeGen/WebAssembly/lower-em-sjlj-debuginfo.ll @@ -1,4 +1,4 @@ -; 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" @@ -11,17 +11,16 @@ define void @setjmp_debug_info0() !dbg !3 { ; 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:.*]] @@ -29,8 +28,7 @@ entry: ; 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]] @@ -53,21 +51,21 @@ define void @setjmp_debug_info1() !dbg !9 { ; 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} -- 2.7.4