aboutsummaryrefslogtreecommitdiff
path: root/test/PCH/irgen-rdar13114142.mm
blob: bd523c29cf328e95773bb466ca20c4f38bb4cdd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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