Bug 1814798 - pt 1. Add bool to enable/disable PHC at runtime r=glandium
[gecko.git] / build / clang-plugin / tests / TestLoadLibraryUsage.cpp
blob319c9d6b2aed1afc154febf36c5c2ad6079fa973
1 #include <windows.h>
2 #include "prlink.h"
4 void Func() {
5 auto h1 = PR_LoadLibrary(nullptr); // expected-error {{Usage of ASCII file functions (such as PR_LoadLibrary) is forbidden.}}
6 auto h2 = PR_LoadLibrary("C:\\Some\\Path");
7 auto h3 = LoadLibraryA(nullptr); // expected-error {{Usage of ASCII file functions (such as LoadLibraryA) is forbidden.}}
8 auto h4 = LoadLibraryA("C:\\Some\\Path");
9 auto h5 = LoadLibraryExA(nullptr, nullptr, 0); // expected-error {{Usage of ASCII file functions (such as LoadLibraryExA) is forbidden.}}
10 auto h6 = LoadLibraryExA("C:\\Some\\Path", nullptr, 0);
12 #ifndef UNICODE
13 // LoadLibrary is a defnine for LoadLibraryA
14 auto h7 = LoadLibrary(nullptr); // expected-error {{Usage of ASCII file functions (such as LoadLibraryA) is forbidden.}}
15 auto h8 = LoadLibrary("C:\\Some\\Path");
16 // LoadLibraryEx is a define for LoadLibraryExA
17 auto h9 = LoadLibraryEx(nullptr, nullptr, 0); // expected-error {{Usage of ASCII file functions (such as LoadLibraryExA) is forbidden.}}
18 auto h10 = LoadLibraryEx("C:\\Some\\Path", nullptr, 0);
19 #endif