xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/PR19955.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple i686-windows-msvc -fno-rtti -emit-llvm -std=c++1y -O0 -o - %s | FileCheck %s
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-windows-msvc -fno-rtti -emit-llvm -std=c++1y -O0 -o - %s | FileCheck %s --check-prefix X64
3*0a6a1f1dSLionel Sambuc 
4*0a6a1f1dSLionel Sambuc extern int __declspec(dllimport) var;
5*0a6a1f1dSLionel Sambuc extern void __declspec(dllimport) fun();
6*0a6a1f1dSLionel Sambuc 
7*0a6a1f1dSLionel Sambuc extern int *varp;
8*0a6a1f1dSLionel Sambuc int *varp = &var;
9*0a6a1f1dSLionel Sambuc // CHECK-DAG: @"\01?varp@@3PAHA" = global i32* null
10*0a6a1f1dSLionel Sambuc // X64-DAG: @"\01?varp@@3PEAHEA" = global i32* null
11*0a6a1f1dSLionel Sambuc 
12*0a6a1f1dSLionel Sambuc extern void (*funp)();
13*0a6a1f1dSLionel Sambuc void (*funp)() = &fun;
14*0a6a1f1dSLionel Sambuc // CHECK-DAG: @"\01?funp@@3P6AXXZA" = global void ()* null
15*0a6a1f1dSLionel Sambuc // X64-DAG: @"\01?funp@@3P6AXXZEA" = global void ()* null
16*0a6a1f1dSLionel Sambuc 
17*0a6a1f1dSLionel Sambuc // CHECK-LABEL: @"\01??__Evarp@@YAXXZ"
18*0a6a1f1dSLionel Sambuc // CHECK-DAG: store i32* @"\01?var@@3HA", i32** @"\01?varp@@3PAHA"
19*0a6a1f1dSLionel Sambuc 
20*0a6a1f1dSLionel Sambuc // X64-LABEL: @"\01??__Evarp@@YAXXZ"
21*0a6a1f1dSLionel Sambuc // X64-DAG: store i32* @"\01?var@@3HA", i32** @"\01?varp@@3PEAHEA"
22*0a6a1f1dSLionel Sambuc 
23*0a6a1f1dSLionel Sambuc // CHECK-LABEL: @"\01??__Efunp@@YAXXZ"()
24*0a6a1f1dSLionel Sambuc // CHECK-DAG: store void ()* @"\01?fun@@YAXXZ", void ()** @"\01?funp@@3P6AXXZA"
25*0a6a1f1dSLionel Sambuc 
26*0a6a1f1dSLionel Sambuc // X64-LABEL: @"\01??__Efunp@@YAXXZ"()
27*0a6a1f1dSLionel Sambuc // X64-DAG: store void ()* @"\01?fun@@YAXXZ", void ()** @"\01?funp@@3P6AXXZEA"
28