[LVI] Add trunc to i1 handling. (#124480)
[llvm-project.git] / compiler-rt / test / asan / TestCases / Windows / dll_global_dead_strip.c
bloba0c96622efeea41b0b13e0d6209832524ee34afb
1 // RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t
2 //
3 // RUN: %clang_cl_nocxx_asan %Gw %LD %Od %s %Fe%t.dll
4 // RUN: %env_asan_opts=report_globals=2 %run %t %t.dll 2>&1 | FileCheck %s --check-prefix=NOSTRIP
5 // RUN: %clang_cl_nocxx_asan %Gw %LD -O2 %s %Fe%t.dll \
6 // RUN: %if target={{.*-windows-gnu}} %{ -Wl,--gc-sections %} \
7 // RUN: %else %{ -link -opt:ref %}
8 // RUN: %env_asan_opts=report_globals=2 %run %t %t.dll 2>&1 | FileCheck %s --check-prefix=STRIP
10 #include <stdio.h>
12 int dead_global = 42;
13 int live_global = 0;
15 __declspec(dllexport)
16 int test_function() {
17 puts("main");
18 return live_global;
21 // Check that our global registration scheme works with MSVC's linker dead
22 // stripping (/OPT:REF).
24 // NOSTRIP: Added Global{{.*}}name=dead_global
25 // NOSTRIP: Added Global{{.*}}name=live_global
26 // NOSTRIP: main
28 // STRIP-NOT: Added Global{{.*}}name=dead_global
29 // STRIP: Added Global{{.*}}name=live_global
30 // STRIP: main