summaryrefslogtreecommitdiff
path: root/test/regression
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-06-13 18:11:19 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-06-13 18:11:19 +0000
commita5ffc59246b09a389e5f8cbc2f217e323e76990f (patch)
treee1bc7cc54518aad7c20645f187cee8110de8cff9 /test/regression
parent4daccd62b92b23016d3f343d5691f9c164a8a951 (diff)
Revised handling of annotation statements, and more generally built-in functions, and more generally external functions
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1672 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/regression')
-rw-r--r--test/regression/annot1.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/regression/annot1.c b/test/regression/annot1.c
index 42ab826..85ba9f7 100644
--- a/test/regression/annot1.c
+++ b/test/regression/annot1.c
@@ -2,22 +2,23 @@
/* Annotations */
-int f(int x, int y)
+int f(int x)
{
- return __builtin_annotation("f(%1,%2)", x, y);
+ return __builtin_annot_intval("f(%1)", x + 1);
}
-double g(double x)
+double g(double x, double y)
{
- return __builtin_annotation("g(%1 + 1.0)", x + 1.0);
+ __builtin_annot("g(%1, %2)", x, y);
+ return x + y;
}
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));
+ __builtin_annot("calling f");
+ printf("f returns %d\n", f(12));
+ __builtin_annot("calling g");
+ printf("g returns %.2f\n", g(3.14, 2.718));
return 0;
}