brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 4368755 Raw
26 lines · c
1// RUN: %clang -fplugin=%llvmshlibdir/AnnotateFunctions%pluginext -emit-llvm -DPRAGMA_ON -S %s -o - | FileCheck %s --check-prefix=PRAGMA2// RUN: %clang -fplugin=%llvmshlibdir/AnnotateFunctions%pluginext -emit-llvm -S %s -o - | FileCheck %s --check-prefix=NOPRAGMA3// RUN: not %clang -fplugin=%llvmshlibdir/AnnotateFunctions%pluginext -emit-llvm -DBAD_PRAGMA -S %s -o - 2>&1 | FileCheck %s --check-prefix=BADPRAGMA4// REQUIRES: plugins, examples5 6#ifdef PRAGMA_ON7#pragma enable_annotate8#endif9 10// BADPRAGMA: warning: extra tokens at end of #pragma directive11#ifdef BAD_PRAGMA12#pragma enable_annotate something13#endif14 15// PRAGMA: [[STR_VAR:@.+]] = private unnamed_addr constant [19 x i8] c"example_annotation\00"16// PRAGMA: @llvm.global.annotations = {{.*}}@fn1{{.*}}[[STR_VAR]]{{.*}}@fn2{{.*}}[[STR_VAR]]17// NOPRAGMA-NOT: {{@.+}} = private unnamed_addr constant [19 x i8] c"example_annotation\00"18// NOPRAGMA-NOT: @llvm.global.annotations = {{.*}}19void fn1() { }20void fn2() { }21 22// BADPRAGMA: error: #pragma enable_annotate not allowed after declarations23#ifdef BAD_PRAGMA24#pragma enable_annotate25#endif26