]> granicus.if.org Git - clang/commitdiff
Add a test case, to make sure there is no crash on IRGen when using PCH
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 28 Feb 2013 01:13:53 +0000 (01:13 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 28 Feb 2013 01:13:53 +0000 (01:13 +0000)
Related to rdar://13114142

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176227 91177308-0d34-0410-b5e6-96231b3b80d8

test/PCH/irgen-rdar13114142.mm [new file with mode: 0644]

diff --git a/test/PCH/irgen-rdar13114142.mm b/test/PCH/irgen-rdar13114142.mm
new file mode 100644 (file)
index 0000000..bd523c2
--- /dev/null
@@ -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