brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · e48acbf Raw
54 lines · cpp
1// RUN: %clang_cc1 -emit-llvm -triple=i386-pc-win32 %s -o - | FileCheck %s2// RUN: %clang_cc1 -emit-llvm -triple=x86_64-windows-msvc %s -o - | FileCheck %s3 4struct 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;12};13 14const int *foo1() {15  return &S::NoInit_Ref;16};17 18const int *foo2() {19  return &S::Inline_NotDef_Ref;20};21 22const int *foo3() {23  return &S::Inline_Def_Ref;24};25 26const int *foo4() {27    return &S::OutOfLine_Def_Ref;28};29 30const int S::Inline_Def_NotRef;31const int S::Inline_Def_Ref;32const int S::OutOfLine_Def_NotRef = 5;33const int S::OutOfLine_Def_Ref = 5;34 35 36// No initialization.37// CHECK-DAG: @"?NoInit_Ref@S@@2HB" = external dso_local constant i3238 39// Inline initialization, no real definiton, not referenced.40// CHECK-NOT: @"?Inline_NotDef_NotRef@S@@2HB" = {{.*}} constant i32 541 42// Inline initialization, no real definiton, referenced.43// CHECK-DAG: @"?Inline_NotDef_Ref@S@@2HB" = linkonce_odr dso_local constant i32 5, comdat, align 444 45// Inline initialization, real definiton, not referenced.46// CHECK-NOT: @"?Inline_Def_NotRef@S@@2HB" = dso_local constant i32 5, align 447 48// Inline initialization, real definiton, referenced.49// CHECK-DAG: @"?Inline_Def_Ref@S@@2HB" = linkonce_odr dso_local constant i32 5, comdat, align 450 51// Out-of-line initialization.52// CHECK-DAG: @"?OutOfLine_Def_NotRef@S@@2HB" = dso_local constant i32 5, align 453// CHECK-DAG: @"?OutOfLine_Def_Ref@S@@2HB" = dso_local constant i32 5, align 454