r176227 - Add a test case, to make sure there is no crash on IRGen when using PCH

Argyrios Kyrtzidis akyrtzi at gmail.com
Wed Feb 27 17:13:53 PST 2013


Author: akirtzidis
Date: Wed Feb 27 19:13:53 2013
New Revision: 176227

URL: http://llvm.org/viewvc/llvm-project?rev=176227&view=rev
Log:
Add a test case, to make sure there is no crash on IRGen when using PCH

Related to rdar://13114142

Added:
    cfe/trunk/test/PCH/irgen-rdar13114142.mm

Added: cfe/trunk/test/PCH/irgen-rdar13114142.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/irgen-rdar13114142.mm?rev=176227&view=auto
==============================================================================
--- cfe/trunk/test/PCH/irgen-rdar13114142.mm (added)
+++ cfe/trunk/test/PCH/irgen-rdar13114142.mm Wed Feb 27 19:13:53 2013
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 %s -emit-pch -o %t.pch
+// RUN: %clang_cc1 %s -emit-llvm %s -include-pch %t.pch -o - | FileCheck %s
+
+#ifndef HEADER
+#define HEADER
+
+class OOArray{
+public:
+  ~OOArray();
+};
+
+class OOString {
+public:
+    OOString();
+    OOString(char *);
+};
+
+class OOPattern {
+public:
+    OOArray matchAll(const OOString &)const {
+        __attribute__((__blocks__(byref))) OOArray out;
+    }
+};
+
+OOArray operator & (const OOPattern & pattern) {
+    pattern.matchAll(0);
+}
+OOArray operator & (OOString, OOString);
+
+#else
+
+// We just make sure there is no crash on IRGen (rdar://13114142)
+// CHECK: _Z3foov()
+void foo() {
+  OOString str;
+  str & "o";
+}
+
+#endif





More information about the cfe-commits mailing list