diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-09-01 08:36:03 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-09-01 08:36:03 +0000 |
commit | 99f47c7a99b11c9cc3429fc0e5d0e21ae3707518 (patch) | |
tree | f452a9d6f8ec4c4573a7ca55581a0060d315f510 /test/regression/annot1.c | |
parent | 1b8e228a2c5d8f63ffa28c1fcef68f64a0408900 (diff) | |
download | compcert-99f47c7a99b11c9cc3429fc0e5d0e21ae3707518.tar.gz compcert-99f47c7a99b11c9cc3429fc0e5d0e21ae3707518.zip |
Adding __builtin_annotation
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1497 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/regression/annot1.c')
-rw-r--r-- | test/regression/annot1.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/regression/annot1.c b/test/regression/annot1.c new file mode 100644 index 00000000..42ab826f --- /dev/null +++ b/test/regression/annot1.c @@ -0,0 +1,23 @@ +#include <stdio.h> + +/* Annotations */ + +int f(int x, int y) +{ + return __builtin_annotation("f(%1,%2)", x, y); +} + +double g(double x) +{ + return __builtin_annotation("g(%1 + 1.0)", x + 1.0); +} + +int main() +{ + __builtin_annotation("calling f"); + printf("f returns %d\n", f(12, 34)); + __builtin_annotation("calling g"); + printf("f returns %.2f\n", g(3.14)); + return 0; +} + |