Files
clang-p2996/clang/test/CodeGenCXX/PR19955.cpp
Rafael Espindola 922f2aa9b2 Bring r325915 back.
The tests that failed on a windows host have been fixed.

Original message:

Start setting dso_local for COFF.

With this there are still some GVs where we don't set dso_local
because setGVProperties is never called. I intend to fix that in
followup commits. This is just the bare minimum to teach
shouldAssumeDSOLocal what it should do for COFF.

llvm-svn: 325940
2018-02-23 19:30:48 +00:00

28 lines
1.1 KiB
C++

// RUN: %clang_cc1 -triple i686-windows-msvc -fms-extensions -fno-rtti -emit-llvm -std=c++1y -O0 -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-windows-msvc -fms-extensions -fno-rtti -emit-llvm -std=c++1y -O0 -o - %s | FileCheck %s --check-prefix X64
extern int __declspec(dllimport) var;
extern void __declspec(dllimport) fun();
extern int *varp;
int *varp = &var;
// CHECK-DAG: @"\01?varp@@3PAHA" = dso_local global i32* null
// X64-DAG: @"\01?varp@@3PEAHEA" = dso_local global i32* null
extern void (*funp)();
void (*funp)() = &fun;
// CHECK-DAG: @"\01?funp@@3P6AXXZA" = dso_local global void ()* null
// X64-DAG: @"\01?funp@@3P6AXXZEA" = dso_local global void ()* null
// CHECK-LABEL: @"\01??__Evarp@@YAXXZ"
// CHECK-DAG: store i32* @"\01?var@@3HA", i32** @"\01?varp@@3PAHA"
// X64-LABEL: @"\01??__Evarp@@YAXXZ"
// X64-DAG: store i32* @"\01?var@@3HA", i32** @"\01?varp@@3PEAHEA"
// CHECK-LABEL: @"\01??__Efunp@@YAXXZ"()
// CHECK-DAG: store void ()* @"\01?fun@@YAXXZ", void ()** @"\01?funp@@3P6AXXZA"
// X64-LABEL: @"\01??__Efunp@@YAXXZ"()
// X64-DAG: store void ()* @"\01?fun@@YAXXZ", void ()** @"\01?funp@@3P6AXXZEA"