From b39791601bb128c37db82eb66a8bc1991047818f Mon Sep 17 00:00:00 2001 From: xleroy Date: Tue, 14 Jun 2011 11:55:11 +0000 Subject: Coloringaux: better cost estimate for annotation builtins Regression: more tests for annotations git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1675 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- test/regression/annot1.c | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/regression/annot1.c b/test/regression/annot1.c index 85ba9f7..2763a8c 100644 --- a/test/regression/annot1.c +++ b/test/regression/annot1.c @@ -7,18 +7,54 @@ int f(int x) return __builtin_annot_intval("f(%1)", x + 1); } -double g(double x, double y) +double g(double x, double y, double u, double v) { - __builtin_annot("g(%1, %2)", x, y); + __builtin_annot("g(%1, %2, %3, %4)", x, y, u, v); return x + y; } +int h(int a) +{ + /* Force spilling */ + int b = a+1; + int c = b+1; + int d = c+1; + int e = d+1; + int f = e+1; + int g = f+1; + int h = g+1; + int i = h+1; + int j = i+1; + int k = j+1; + int l = k+1; + int m = l+1; + int n = m+1; + int o = n+1; + int p = o+1; + int q = p+1; + int r = q+1; + int s = r+1; + int t = s+1; + int u = t+1; + int v = u+1; + int w = v+1; + int x = w+1; + int y = x+1; + int z = y+1; + int aa = z+1; + int bb = aa+1; + int cc = bb+1; + int dd = cc+1; + __builtin_annot("h %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16 %17 %18 %19 %20 %21 %22 %23 %24 %25 %26 %27 %28 %29 %30", a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, bb, cc, dd); + return dd; +} + int main() { __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)); + printf("g returns %.2f\n", g(3.14, 2.718, 0, 1)); return 0; } -- cgit v1.2.3