38 lines · c
1// RUN: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s2// RUN: %clang_cc1 %s -triple thumbv7-windows -fms-extensions -emit-llvm -o - | FileCheck %s3// RUN: %clang_cc1 %s -triple x86_64-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s4// RUN: %clang_cc1 %s -triple thumbv7-linux-gnueabihf -fms-extensions -emit-llvm -o - | FileCheck -check-prefix ELF %s --implicit-check-not llvm.linker.options5// RUN: %clang_cc1 %s -triple i686-pc-linux -fms-extensions -emit-llvm -o - | FileCheck -check-prefix ELF %s --implicit-check-not llvm.linker.options6// RUN: %clang_cc1 %s -triple x86_64-scei-ps4 -fms-extensions -emit-llvm -o - | FileCheck -check-prefix ELF %s --implicit-check-not llvm.linker.options7// RUN: %clang_cc1 %s -triple x86_64-sie-ps5 -fms-extensions -emit-llvm -o - | FileCheck -check-prefix ELF %s --implicit-check-not llvm.linker.options8// RUN: %clang_cc1 %s -triple aarch64-windows-msvc -fms-extensions -emit-llvm -o - | FileCheck %s9// RUN: %clang_cc1 %s -triple mipsel-windows-msvc -fms-extensions -emit-llvm -o - | FileCheck %s10 11#pragma comment(lib, "msvcrt.lib")12#pragma comment(lib, "kernel32")13#pragma comment(lib, "USER32.LIB")14#pragma comment(lib, "with space")15 16#define BAR "2"17#pragma comment(linker," /bar=" BAR)18#pragma comment(linker," /foo=\"foo bar\"")19 20// CHECK: !llvm.linker.options = !{![[msvcrt:[0-9]+]], ![[kernel32:[0-9]+]], ![[USER32:[0-9]+]], ![[space:[0-9]+]], ![[bar:[0-9]+]], ![[foo:[0-9]+]]}21// CHECK: ![[msvcrt]] = !{!"/DEFAULTLIB:msvcrt.lib"}22// CHECK: ![[kernel32]] = !{!"/DEFAULTLIB:kernel32.lib"}23// CHECK: ![[USER32]] = !{!"/DEFAULTLIB:USER32.LIB"}24// CHECK: ![[space]] = !{!"/DEFAULTLIB:\22with space.lib\22"}25// CHECK: ![[bar]] = !{!" /bar=2"}26// CHECK: ![[foo]] = !{!" /foo=\22foo bar\22"}27 28// ELF: !llvm.dependent-libraries = !{![[msvcrt:[0-9]+]], ![[kernel32:[0-9]+]], ![[USER32:[0-9]+]], ![[space:[0-9]+]]29// ELF: ![[msvcrt]] = !{!"msvcrt.lib"}30// ELF: ![[kernel32]] = !{!"kernel32"}31// ELF: ![[USER32]] = !{!"USER32.LIB"}32// ELF: ![[space]] = !{!"with space"}33// ELF-NOT: bar34// ELF-NOT: foo35// This following match prevents the clang version metadata from matching the forbidden 'foo' and 'bar' tokens.36// This can happen if the clang version string contains a Git repo URL that includes one of those substrings.37// ELF-LABEL: {{\!\".*clang version}}38