[llvm-commits] [llvm] r113249 - /llvm/trunk/test/FrontendC/2007-10-01-BuildArrayRef.c

Stuart Hastings stuart at apple.com
Tue Sep 7 11:43:57 PDT 2010


Author: stuart
Date: Tue Sep  7 13:43:57 2010
New Revision: 113249

URL: http://llvm.org/viewvc/llvm-project?rev=113249&view=rev
Log:
Test case for r113248.  Raar 8361341.

Modified:
    llvm/trunk/test/FrontendC/2007-10-01-BuildArrayRef.c

Modified: llvm/trunk/test/FrontendC/2007-10-01-BuildArrayRef.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2007-10-01-BuildArrayRef.c?rev=113249&r1=113248&r2=113249&view=diff
==============================================================================
--- llvm/trunk/test/FrontendC/2007-10-01-BuildArrayRef.c (original)
+++ llvm/trunk/test/FrontendC/2007-10-01-BuildArrayRef.c Tue Sep  7 13:43:57 2010
@@ -1,8 +1,20 @@
-// RUN: not %llvmgcc -S %s -o /dev/null |& grep "error: assignment of read-only location"
+// RUN: not %llvmgcc_only -c %s -o /dev/null |& FileCheck %s
 // PR 1603
-int func()
+void func()
 {
    const int *arr;
-   arr[0] = 1;
+   arr[0] = 1;  // CXHECK: error: assignment of read-only location
 }
 
+struct foo {
+  int bar;
+};
+struct foo sfoo = { 0 };
+
+int func2()
+{
+  const struct foo *fp;
+  fp = &sfoo;
+  fp[0].bar = 1;  // CHECK: error: assignment of read-only member 'bar'
+  return sfoo.bar;
+}





More information about the llvm-commits mailing list