[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / debug-info-globalinit.cpp
blobbcadc6b0b28b98c6b016517d69fb86e1ee6468bf
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s -std=c++11 -debug-info-kind=limited | FileCheck %s
3 void crash() {
4 volatile char *ptr = 0;
5 char x = *ptr;
8 int test() {
9 crash();
10 return 1;
13 static int i = test();
14 __attribute__((nodebug)) static int j = test();
15 static int k = test();
17 int main(void) {}
19 // CHECK-LABEL: define internal void @__cxx_global_var_init()
20 // CHECK-NOT: __cxx_global_var_init
21 // CHECK: %[[C0:.+]] = call noundef i32 @_Z4testv(), !dbg ![[LINE:.*]]
22 // CHECK-NOT: __cxx_global_var_init
23 // CHECK: store i32 %[[C0]], ptr @_ZL1i, align 4, !dbg
24 //
25 // CHECK-LABEL: define internal void @__cxx_global_var_init.1()
26 // CHECK-NOT: dbg
27 // CHECK: %[[C1:.+]] = call noundef i32 @_Z4testv()
28 // CHECK-NOT: dbg
29 // CHECK: store i32 %[[C1]], ptr @_ZL1j, align 4
31 // CHECK-LABEL: define internal void @__cxx_global_var_init.2()
32 // CHECK-NOT: __cxx_global_var_init
33 // CHECK: %[[C2:.+]] = call noundef i32 @_Z4testv(), !dbg ![[LINE2:.*]]
34 // CHECK-NOT: __cxx_global_var_init
35 // CHECK: store i32 %[[C2]], ptr @_ZL1k, align 4, !dbg
36 //
37 // CHECK: ![[LINE]] = !DILocation(line: 13,
38 // CHECK: ![[LINE2]] = !DILocation(line: 15,