A better testcase. This doesn't mean it's good, just better :) The gcc testsuite contains more comprehensive tests. I thought of importing some of them into the LLVM testsuite, but I've decided to wait until there is some kind of consensus as to what should be done about the gcc testsuite in general - import the relevant bits into LLVM? Turn off the irrelevant bits in gcc?
Ciao, Duncan.
Index: llvm/test/CFrontend/2007-02-05-nested.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ llvm/test/CFrontend/2007-02-05-nested.c 2007-02-06 10:11:44.000000000 +0100 @@ -0,0 +1,54 @@ +// RUN: %llvmgcc -S -fnested-functions -O3 -o - -emit-llvm %s | not grep abort +// PR915 + +extern void abort(void); + +void nest(int n) +{ + int a = 0; + int b = 5; + int c = 0; + int d = 7; + + void o(int i, int j) + { + if (i!=j) + abort(); + } + + void f(x) + int x; /* K&R style */ + { + int e = 0; + int f = 2; + int g = 0; + + void y(void) + { + c = n; + e = 1; + g = x; + } + + void z(void) + { + a = 4; + g = 3; + } + + a = 5; + y(); + c = x; + z(); + o(1,e); + o(2,f); + o(3,g); + } + + c = 2; + f(6); + o(4,a); + o(5,b); + o(6,c); + o(7,d); +}
_______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits