[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / annotations-decl-use-decl.c
blobf43ba91a34d876fcdb5ac6a5811b4d47b35f246e
1 // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
3 // Test annotation attributes are still emitted when the function is used before
4 // it is defined with annotations.
6 void foo(void);
7 void *xxx = (void*)foo;
8 void __attribute__((annotate("bar"))) foo();
10 // CHECK: target triple
11 // CHECK-DAG: private unnamed_addr constant [4 x i8] c"bar\00", section "llvm.metadata"
13 // CHECK: @llvm.global.annotations = appending global [1 x { ptr, ptr, ptr, i32, ptr }] [{
14 // CHECK-SAME: { ptr @foo,
15 // CHECK-SAME: }], section "llvm.metadata"