brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · d617a6e Raw
72 lines · plain
1; REQUIRES: x862 3; RUN: rm -rf %t.dir4; RUN: split-file %s %t.dir5; RUN: llvm-as %t.dir/main.ll -o %t.main.obj6; RUN: llvm-as %t.dir/other1.ll -o %t.other1.obj7; RUN: llvm-as %t.dir/other2.ll -o %t.other2.obj8 9; RUN: lld-link /entry:entry %t.main.obj %t.other1.obj /out:%t1.exe /subsystem:console /debug:symtab10 11;; Check that we don't retain __imp_ prefixed symbols we don't need.12; RUN: llvm-nm %t1.exe | FileCheck %s13; CHECK-NOT: __imp_unusedFunc14 15; RUN: lld-link /entry:entry %t.main.obj %t.other2.obj /out:%t2.exe /subsystem:console16 17;--- main.ll18target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"19target triple = "x86_64-w64-windows-gnu"20 21define void @entry() {22entry:23  tail call void @importedFunc()24  tail call void @other()25  ret void26}27 28declare dllimport void @importedFunc()29 30declare void @other()31 32;--- other1.ll33target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"34target triple = "x86_64-w64-windows-gnu"35 36@__imp_importedFunc = global ptr @importedFuncReplacement37 38define internal void @importedFuncReplacement() {39entry:40  ret void41}42 43@__imp_unusedFunc = global ptr @unusedFuncReplacement44 45define internal void @unusedFuncReplacement() {46entry:47  ret void48}49 50define void @other() {51entry:52  ret void53}54 55;--- other2.ll56target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"57target triple = "x86_64-w64-windows-gnu"58 59@__imp_importedFunc = global ptr @importedFunc60 61; Test with two external symbols with the same name, with/without the __imp_62; prefix.63define void @importedFunc() {64entry:65  ret void66}67 68define void @other() {69entry:70  ret void71}72