mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-05-14 01:46:41 +00:00

Previously, annotations were only emitted for function definitions. With this change annotations are also emitted for declarations. Also, emitting function annotations is now deferred until the end so that the most up to date declaration is used which will have any inherited annotations.
18 lines
467 B
C
18 lines
467 B
C
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
|
|
|
|
// Test annotation attributes are emitted for declarations.
|
|
|
|
__attribute__((annotate("bar"))) int foo();
|
|
|
|
int main() {
|
|
return foo();
|
|
}
|
|
|
|
// CHECK: target triple
|
|
// CHECK-DAG: private unnamed_addr constant [4 x i8] c"bar\00", section "llvm.metadata"
|
|
|
|
// CHECK: @llvm.global.annotations = appending global [1 x { ptr, ptr, ptr, i32, ptr }] [{
|
|
// CHECK-SAME: { ptr @foo,
|
|
// CHECK-SAME: }], section "llvm.metadata"
|
|
|