mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-30 07:33:23 +00:00
add a testcase for a bug Duncan pointed out.
llvm-svn: 46372
This commit is contained in:
parent
10316ffbb2
commit
c2df169459
10
test/CFrontend/2008-01-25-ByValReadNone.c
Normal file
10
test/CFrontend/2008-01-25-ByValReadNone.c
Normal file
@ -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]; }
|
||||
|
Loading…
Reference in New Issue
Block a user