mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-19 03:29:22 +00:00
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46372 91177308-0d34-0410-b5e6-96231b3b80d8
11 lines
392 B
C
11 lines
392 B
C
// 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]; }
|
|
|