1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc // It could hit in @llvm.memcpy with "-triple x86_64-(mingw32|win32)".
4*f4a2713aSLionel Sambuc // CHECK-NOT: readonly
5*f4a2713aSLionel Sambuc // CHECK-NOT: readnone
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambuc // The struct being passed byval means that we cannot mark the
8*f4a2713aSLionel Sambuc // function readnone. Readnone would allow stores to the arg to
9*f4a2713aSLionel Sambuc // be deleted in the caller. We also don't allow readonly since
10*f4a2713aSLionel Sambuc // the callee might write to the byval parameter. The inliner
11*f4a2713aSLionel Sambuc // would have to assume the worse and introduce an explicit
12*f4a2713aSLionel Sambuc // temporary when inlining such a function, which is costly for
13*f4a2713aSLionel Sambuc // the common case in which the byval argument is not written.
14*f4a2713aSLionel Sambuc struct S { int A[1000]; };
f(struct S x)15*f4a2713aSLionel Sambuc int __attribute__ ((const)) f(struct S x) { x.A[1] = 0; return x.A[0]; }
16*f4a2713aSLionel Sambuc int g(struct S x) __attribute__ ((pure));
h(struct S x)17*f4a2713aSLionel Sambuc int h(struct S x) { return g(x); }
18