brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · bcadc6b Raw
39 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s -std=c++11 -debug-info-kind=limited | FileCheck %s2 3void crash() {4  volatile char *ptr = 0;5  char x = *ptr;6}7 8int test() {9  crash();10  return 1;11}12 13static int i = test();14__attribute__((nodebug)) static int j = test();15static int k = test();16 17int main(void) {}18 19// CHECK-LABEL: define internal void @__cxx_global_var_init()20// CHECK-NOT: __cxx_global_var_init21// CHECK: %[[C0:.+]] = call noundef i32 @_Z4testv(), !dbg ![[LINE:.*]]22// CHECK-NOT: __cxx_global_var_init23// CHECK: store i32 %[[C0]], ptr @_ZL1i, align 4, !dbg24// 25// CHECK-LABEL: define internal void @__cxx_global_var_init.1()26// CHECK-NOT: dbg27// CHECK: %[[C1:.+]] = call noundef i32 @_Z4testv()28// CHECK-NOT: dbg29// CHECK: store i32 %[[C1]], ptr @_ZL1j, align 430//31// CHECK-LABEL: define internal void @__cxx_global_var_init.2()32// CHECK-NOT: __cxx_global_var_init33// CHECK: %[[C2:.+]] = call noundef i32 @_Z4testv(), !dbg ![[LINE2:.*]]34// CHECK-NOT: __cxx_global_var_init35// CHECK: store i32 %[[C2]], ptr @_ZL1k, align 4, !dbg36// 37// CHECK: ![[LINE]] = !DILocation(line: 13,38// CHECK: ![[LINE2]] = !DILocation(line: 15,39