From a5ffc59246b09a389e5f8cbc2f217e323e76990f Mon Sep 17 00:00:00 2001 From: xleroy Date: Mon, 13 Jun 2011 18:11:19 +0000 Subject: 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 --- test/regression/annot1.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/regression/annot1.c b/test/regression/annot1.c index 42ab826f..85ba9f72 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; } -- cgit