[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / ms-integer-static-data-members.cpp
blobe48acbf06f740159cca53a6a05df2de398a69518
1 // RUN: %clang_cc1 -emit-llvm -triple=i386-pc-win32 %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -emit-llvm -triple=x86_64-windows-msvc %s -o - | FileCheck %s
4 struct S {
5 static const int NoInit_Ref;
6 static const int Inline_NotDef_NotRef = 5;
7 static const int Inline_NotDef_Ref = 5;
8 static const int Inline_Def_NotRef = 5;
9 static const int Inline_Def_Ref = 5;
10 static const int OutOfLine_Def_NotRef;
11 static const int OutOfLine_Def_Ref;
14 const int *foo1() {
15 return &S::NoInit_Ref;
18 const int *foo2() {
19 return &S::Inline_NotDef_Ref;
22 const int *foo3() {
23 return &S::Inline_Def_Ref;
26 const int *foo4() {
27 return &S::OutOfLine_Def_Ref;
30 const int S::Inline_Def_NotRef;
31 const int S::Inline_Def_Ref;
32 const int S::OutOfLine_Def_NotRef = 5;
33 const int S::OutOfLine_Def_Ref = 5;
36 // No initialization.
37 // CHECK-DAG: @"?NoInit_Ref@S@@2HB" = external dso_local constant i32
39 // Inline initialization, no real definiton, not referenced.
40 // CHECK-NOT: @"?Inline_NotDef_NotRef@S@@2HB" = {{.*}} constant i32 5
42 // Inline initialization, no real definiton, referenced.
43 // CHECK-DAG: @"?Inline_NotDef_Ref@S@@2HB" = linkonce_odr dso_local constant i32 5, comdat, align 4
45 // Inline initialization, real definiton, not referenced.
46 // CHECK-NOT: @"?Inline_Def_NotRef@S@@2HB" = dso_local constant i32 5, align 4
48 // Inline initialization, real definiton, referenced.
49 // CHECK-DAG: @"?Inline_Def_Ref@S@@2HB" = linkonce_odr dso_local constant i32 5, comdat, align 4
51 // Out-of-line initialization.
52 // CHECK-DAG: @"?OutOfLine_Def_NotRef@S@@2HB" = dso_local constant i32 5, align 4
53 // CHECK-DAG: @"?OutOfLine_Def_Ref@S@@2HB" = dso_local constant i32 5, align 4