1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s -std=c++11 -g | FileCheck %s
2
crash()3 void crash() {
4 volatile char *ptr = 0;
5 char x = *ptr;
6 }
7
test()8 int test() {
9 crash();
10 return 1;
11 }
12
13 static int i = test();
14 __attribute__((nodebug)) static int j = test();
15
main(void)16 int main(void) {}
17
18 // CHECK: define internal void @__cxx_global_var_init()
19 // CHECK-NOT: __cxx_global_var_init
20 // CHECK: %[[C0:.+]] = call i32 @_Z4testv(), !dbg ![[LINE:.*]]
21 // CHECK-NOT: __cxx_global_var_init
22 // CHECK: store i32 %[[C0]], i32* @_ZL1i, align 4, !dbg
23 //
24 // CHECK: define internal void @__cxx_global_var_init1()
25 // CHECK-NOT: dbg
26 // CHECK: %[[C1:.+]] = call i32 @_Z4testv()
27 // CHECK-NOT: dbg
28 // CHECK: store i32 %[[C1]], i32* @_ZL1j, align 4
29 //
30 // CHECK: ![[LINE]] = metadata !{i32 13, i32
31