Chris Lattner | 847d641 | 2008-01-25 22:36:24 +0000 | [diff] [blame] | 1 | // RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep readonly |
2 | // RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | not grep readnone | ||||
3 | |||||
4 | |||||
5 | // The struct being passed byval means that we need to mark the | ||||
6 | // function readonly instead of readnone. Readnone would allow | ||||
7 | // stores to the arg to be deleted in the caller. | ||||
8 | struct S { int A[1000]; }; | ||||
9 | int __attribute__ ((const)) f(struct S x) { return x.A[0]; } | ||||
10 |