blob: afbf97066c7f5a188c9085dcedf3b72f7f1ecf55 [file] [log] [blame]
Chris Lattner847d6412008-01-25 22:36:24 +00001// 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.
8struct S { int A[1000]; };
9int __attribute__ ((const)) f(struct S x) { return x.A[0]; }
10