1 // RUN: %clang_cc1 -x c -std=c89 -fblocks -debug-info-kind=standalone -emit-llvm -O0 \
2 // RUN: -triple x86_64-apple-darwin -o - %s | FileCheck %s
3 // RUN: %clang_cc1 -x c -std=c89 -fblocks -debug-info-kind=standalone -emit-llvm -O1 \
4 // RUN: -triple x86_64-apple-darwin -o - %s \
5 // RUN: | FileCheck --check-prefix=CHECK-OPT %s
7 // CHECK: define internal void @__f_block_invoke(ptr noundef %.block_descriptor)
8 // CHECK: %.block_descriptor.addr = alloca ptr, align 8
9 // CHECK: %block.addr = alloca ptr, align 8
10 // CHECK: store ptr %.block_descriptor, ptr %.block_descriptor.addr, align 8
11 // CHECK: call void @llvm.dbg.declare(metadata ptr %.block_descriptor.addr,
12 // CHECK-SAME: metadata !DIExpression())
13 // CHECK-OPT-NOT: alloca
14 // Since the block address is not used anywhere in this function,
15 // the optimizer (DeadArgElim) has replaced all the false uses
16 // (i.e., metadata users) with poison.
17 // CHECK-OPT: call void @llvm.dbg.value(metadata ptr poison,
18 // CHECK-OPT-SAME: metadata !DIExpression())