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
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
;
15 return &S::NoInit_Ref
;
19 return &S::Inline_NotDef_Ref
;
23 return &S::Inline_Def_Ref
;
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;
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