1 // RUN: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
2 // RUN: %clang_cc1 %s -triple thumbv7-windows -fms-extensions -emit-llvm -o - | FileCheck %s
3 // RUN: %clang_cc1 %s -triple x86_64-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
4 // RUN: %clang_cc1 %s -triple thumbv7-linux-gnueabihf -fms-extensions -emit-llvm -o - | FileCheck -check-prefix LINUX %s
5 // RUN: %clang_cc1 %s -triple i686-pc-linux -fms-extensions -emit-llvm -o - | FileCheck -check-prefix LINUX %s
6 // RUN: %clang_cc1 %s -triple x86_64-scei-ps4 -fms-extensions -emit-llvm -o - | FileCheck -check-prefix PS4 %s
7 
8 #pragma comment(lib, "msvcrt.lib")
9 #pragma comment(lib, "kernel32")
10 #pragma comment(lib, "USER32.LIB")
11 #pragma comment(lib, "with space")
12 
13 #define BAR "2"
14 #pragma comment(linker," /bar=" BAR)
15 #pragma comment(linker," /foo=\"foo bar\"")
16 
17 // CHECK: !llvm.module.flags = !{{{.*}}}
18 // CHECK: !{{[0-9]+}} = !{i32 6, !"Linker Options", ![[link_opts:[0-9]+]]}
19 // CHECK: ![[link_opts]] = !{![[msvcrt:[0-9]+]], ![[kernel32:[0-9]+]], ![[USER32:[0-9]+]], ![[space:[0-9]+]], ![[bar:[0-9]+]], ![[foo:[0-9]+]]}
20 // CHECK: ![[msvcrt]] = !{!"/DEFAULTLIB:msvcrt.lib"}
21 // CHECK: ![[kernel32]] = !{!"/DEFAULTLIB:kernel32.lib"}
22 // CHECK: ![[USER32]] = !{!"/DEFAULTLIB:USER32.LIB"}
23 // CHECK: ![[space]] = !{!"/DEFAULTLIB:\22with space.lib\22"}
24 // CHECK: ![[bar]] = !{!" /bar=2"}
25 // CHECK: ![[foo]] = !{!" /foo=\22foo bar\22"}
26 
27 // LINUX: !{!"-lmsvcrt.lib"}
28 // LINUX: !{!"-lkernel32"}
29 // LINUX: !{!"-lUSER32.LIB"}
30 // LINUX: !{!" /bar=2"}
31 
32 // PS4: !{!"\01msvcrt.lib"}
33 // PS4: !{!"\01kernel32"}
34 // PS4: !{!"\01USER32.LIB"}
35 // PS4: !{!"\01\22with space\22"}
36