diff options
Diffstat (limited to 'clang/test/CodeGenObjC/forward-declare-protocol-gnu.m')
| -rw-r--r-- | clang/test/CodeGenObjC/forward-declare-protocol-gnu.m | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/forward-declare-protocol-gnu.m b/clang/test/CodeGenObjC/forward-declare-protocol-gnu.m new file mode 100644 index 00000000000..b57a4a48d4a --- /dev/null +++ b/clang/test/CodeGenObjC/forward-declare-protocol-gnu.m @@ -0,0 +1,11 @@ +// RUN: %clang -S -emit-llvm %s -o - -x objective-c -fobjc-runtime=gnustep-1.5 | FileCheck %s + +// Regression test: check that we don't crash when referencing a forward-declared protocol. +@protocol P; + +Protocol *getProtocol(void) +{ + return @protocol(P); +} + +// CHECK: @.objc_protocol |

