On Jan 25, 2008, at 4:35 PM, Evan Cheng wrote: > How would this test case pass if the target does not pass structs > byval?
That's why I picked a big struct. :) -Chris > > Evan > > On Jan 25, 2008, at 2:36 PM, Chris Lattner wrote: > >> Author: lattner >> Date: Fri Jan 25 16:36:24 2008 >> New Revision: 46372 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=46372&view=rev >> Log: >> add a testcase for a bug Duncan pointed out. >> >> Added: >> llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c >> >> Added: llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/ >> 2008-01-25-ByValReadNone.c?rev=46372&view=auto >> >> = >> ===================================================================== >> ======== >> --- llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c (added) >> +++ llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c Fri Jan 25 >> 16:36:24 2008 >> @@ -0,0 +1,10 @@ >> +// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep readonly >> +// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | not grep readnone >> + >> + >> +// The struct being passed byval means that we need to mark the >> +// function readonly instead of readnone. Readnone would allow >> +// stores to the arg to be deleted in the caller. >> +struct S { int A[1000]; }; >> +int __attribute__ ((const)) f(struct S x) { return x.A[0]; } >> + >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits@cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits