mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-30 09:01:19 +00:00
ae9231ca2a
415f7ee883
had LIT test failures on any build where the clang executable
was not called "clang". I have adjusted the LIT CHECKs to remove the
binary name to fix this.
Original commit message:
For PlayStation we offer source code compatibility with
Microsoft's dllimport/export annotations; however, our file
format is based on ELF.
To support this we translate from DLL storage class to ELF
visibility at the end of codegen in Clang.
Other toolchains have used similar strategies (e.g. see the
documentation for this ARM toolchain:
https://developer.arm.com/documentation/dui0530/i/migrating-from-rvct-v3-1-to-rvct-v4-0/changes-to-symbol-visibility-between-rvct-v3-1-and-rvct-v4-0)
This patch adds the ability to perform this translation. Options
are provided to support customizing the mapping behaviour.
Differential Revision: https://reviews.llvm.org/D89970
88 lines
4.5 KiB
C
88 lines
4.5 KiB
C
// Check behaviour of -fvisibility-from-dllstorageclass options
|
|
|
|
// RUN: %clang -target x86_64-unknown-windows-itanium -fdeclspec \
|
|
// RUN: -Werror -S -### %s 2>&1 | \
|
|
// RUN: FileCheck %s \
|
|
// RUN: --implicit-check-not=-fvisibility-from-dllstorageclass \
|
|
// RUN: --implicit-check-not=-fvisibility-dllexport \
|
|
// RUN: --implicit-check-not=-fvisibility-nodllstorageclass \
|
|
// RUN: --implicit-check-not=-fvisibility-externs-dllimport \
|
|
// RUN: --implicit-check-not=-fvisibility-externs-nodllstorageclass
|
|
|
|
// RUN: %clang -target x86_64-unknown-windows-itanium -fdeclspec \
|
|
// RUN: -fvisibility-from-dllstorageclass \
|
|
// RUN: -fno-visibility-from-dllstorageclass \
|
|
// RUN: -Werror -S -### %s 2>&1 | \
|
|
// RUN: FileCheck %s \
|
|
// RUN: --implicit-check-not=-fvisibility-from-dllstorageclass \
|
|
// RUN: --implicit-check-not=-fvisibility-dllexport \
|
|
// RUN: --implicit-check-not=-fvisibility-nodllstorageclass \
|
|
// RUN: --implicit-check-not=-fvisibility-externs-dllimport \
|
|
// RUN: --implicit-check-not=-fvisibility-externs-nodllstorageclass
|
|
|
|
// RUN: %clang -target x86_64-unknown-windows-itanium -fdeclspec \
|
|
// RUN: -fno-visibility-from-dllstorageclass \
|
|
// RUN: -fvisibility-from-dllstorageclass \
|
|
// RUN: -Werror -S -### %s 2>&1 | \
|
|
// RUN: FileCheck %s --check-prefix=SET \
|
|
// RUN: --implicit-check-not=-fvisibility-from-dllstorageclass \
|
|
// RUN: --implicit-check-not=-fvisibility-dllexport \
|
|
// RUN: --implicit-check-not=-fvisibility-nodllstorageclass \
|
|
// RUN: --implicit-check-not=-fvisibility-externs-dllimport \
|
|
// RUN: --implicit-check-not=-fvisibility-externs-nodllstorageclass
|
|
|
|
// RUN: %clang -target x86_64-unknown-windows-itanium -fdeclspec \
|
|
// RUN: -fvisibility-dllexport=hidden \
|
|
// RUN: -fvisibility-nodllstorageclass=protected \
|
|
// RUN: -fvisibility-externs-dllimport=hidden \
|
|
// RUN: -fvisibility-externs-nodllstorageclass=protected \
|
|
// RUN: -S -### %s 2>&1 | \
|
|
// RUN: FileCheck %s --check-prefixes=UNUSED \
|
|
// RUN: --implicit-check-not=-fvisibility-from-dllstorageclass \
|
|
// RUN: --implicit-check-not=-fvisibility-dllexport \
|
|
// RUN: --implicit-check-not=-fvisibility-nodllstorageclass \
|
|
// RUN: --implicit-check-not=-fvisibility-externs-dllimport \
|
|
// RUN: --implicit-check-not=-fvisibility-externs-nodllstorageclass \
|
|
// RUN: --implicit-check-not=error: \
|
|
// RUN: --implicit-check-not=warning:
|
|
|
|
// RUN: %clang -target x86_64-unknown-windows-itanium -fdeclspec \
|
|
// RUN: -fno-visibility-from-dllstorageclass \
|
|
// RUN: -fvisibility-dllexport=hidden \
|
|
// RUN: -fvisibility-nodllstorageclass=protected \
|
|
// RUN: -fvisibility-externs-dllimport=hidden \
|
|
// RUN: -fvisibility-externs-nodllstorageclass=protected \
|
|
// RUN: -S -### %s 2>&1 | \
|
|
// RUN: FileCheck %s --check-prefixes=UNUSED \
|
|
// RUN: --implicit-check-not=-fvisibility-from-dllstorageclass \
|
|
// RUN: --implicit-check-not=-fvisibility-dllexport \
|
|
// RUN: --implicit-check-not=-fvisibility-nodllstorageclass \
|
|
// RUN: --implicit-check-not=-fvisibility-externs-dllimport \
|
|
// RUN: --implicit-check-not=-fvisibility-externs-nodllstorageclass \
|
|
// RUN: --implicit-check-not=error: \
|
|
// RUN: --implicit-check-not=warning:
|
|
|
|
// UNUSED: warning: argument unused during compilation: '-fvisibility-dllexport=hidden'
|
|
// UNUSED-NEXT: warning: argument unused during compilation: '-fvisibility-nodllstorageclass=protected'
|
|
// UNUSED-NEXT: warning: argument unused during compilation: '-fvisibility-externs-dllimport=hidden'
|
|
// UNUSED-NEXT: warning: argument unused during compilation: '-fvisibility-externs-nodllstorageclass=protected'
|
|
|
|
// RUN: %clang -target x86_64-unknown-windows-itanium -fdeclspec \
|
|
// RUN: -fvisibility-from-dllstorageclass \
|
|
// RUN: -fvisibility-dllexport=default \
|
|
// RUN: -fvisibility-dllexport=hidden \
|
|
// RUN: -fvisibility-nodllstorageclass=default \
|
|
// RUN: -fvisibility-nodllstorageclass=protected \
|
|
// RUN: -fvisibility-externs-dllimport=default \
|
|
// RUN: -fvisibility-externs-dllimport=hidden \
|
|
// RUN: -fvisibility-externs-nodllstorageclass=default \
|
|
// RUN: -fvisibility-externs-nodllstorageclass=protected \
|
|
// RUN: -Werror -S -### %s 2>&1 | \
|
|
// RUN: FileCheck %s --check-prefixes=SET,ALL
|
|
|
|
// SET: "-fvisibility-from-dllstorageclass"
|
|
// ALL-SAME: "-fvisibility-dllexport=hidden"
|
|
// ALL-SAME: "-fvisibility-nodllstorageclass=protected"
|
|
// ALL-SAME: "-fvisibility-externs-dllimport=hidden"
|
|
// ALL-SAME: "-fvisibility-externs-nodllstorageclass=protected"
|