1 // RUN: %clang_cc1 -triple i686-windows-msvc -fms-extensions -fno-rtti -emit-llvm -std=c++1y -O0 -o - %s | FileCheck %s
2 // 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
3 
4 extern int __declspec(dllimport) var;
5 extern void __declspec(dllimport) fun();
6 
7 extern int *varp;
8 int *varp = &var;
9 // CHECK-DAG: @"\01?varp@@3PAHA" = global i32* null
10 // X64-DAG: @"\01?varp@@3PEAHEA" = global i32* null
11 
12 extern void (*funp)();
13 void (*funp)() = &fun;
14 // CHECK-DAG: @"\01?funp@@3P6AXXZA" = global void ()* null
15 // X64-DAG: @"\01?funp@@3P6AXXZEA" = global void ()* null
16 
17 // CHECK-LABEL: @"\01??__Evarp@@YAXXZ"
18 // CHECK-DAG: store i32* @"\01?var@@3HA", i32** @"\01?varp@@3PAHA"
19 
20 // X64-LABEL: @"\01??__Evarp@@YAXXZ"
21 // X64-DAG: store i32* @"\01?var@@3HA", i32** @"\01?varp@@3PEAHEA"
22 
23 // CHECK-LABEL: @"\01??__Efunp@@YAXXZ"()
24 // CHECK-DAG: store void ()* @"\01?fun@@YAXXZ", void ()** @"\01?funp@@3P6AXXZA"
25 
26 // X64-LABEL: @"\01??__Efunp@@YAXXZ"()
27 // X64-DAG: store void ()* @"\01?fun@@YAXXZ", void ()** @"\01?funp@@3P6AXXZEA"
28