From: Nico Weber Date: Fri, 11 Sep 2015 21:24:40 +0000 (+0000) Subject: Let selector-expr-lvalue.mm actually test something. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5fc9f2496c66f38c3f1de4b0e33795d4b147d1d;p=clang Let selector-expr-lvalue.mm actually test something. I accidentally introduced a bug locally, and noticed that none of the tests caught it. No longer! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247477 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenObjCXX/selector-expr-lvalue.mm b/test/CodeGenObjCXX/selector-expr-lvalue.mm index 508ea83f0d..bd72686311 100644 --- a/test/CodeGenObjCXX/selector-expr-lvalue.mm +++ b/test/CodeGenObjCXX/selector-expr-lvalue.mm @@ -1,16 +1,23 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s // PR7390 -@interface NSObject {} -- (void)respondsToSelector:(const SEL&)s : (SEL*)s1; -- (void) setPriority:(int)p; +// CHECK: @[[setprioname:[^ ]*]] = {{.*}}"setPriority: +// CHECK-NEXT: @[[setpriosel:[^ ]*]] = {{.*}}getelementptr{{.*}}[[setprioname]] +@interface NSObject +- (void)respondsToSelector:(const SEL &)s ps:(SEL *)s1; +- (void)setPriority:(int)p; - (void)Meth; @end -@implementation NSObject +@implementation NSObject + +// CHECK-LABEL: define internal void @"\01-[NSObject Meth]"( - (void)Meth { - [self respondsToSelector:@selector(setPriority:) : &@selector(setPriority:)]; +// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i8**, i8**)*){{.*}}, i8** @[[setpriosel]]) + [self respondsToSelector:@selector(setPriority:) ps:&@selector(setPriority:)]; +} +- (void)setPriority:(int)p { +} +- (void)respondsToSelector:(const SEL &)s ps:(SEL *)s1 { } -- (void) setPriority:(int)p{} -- (void)respondsToSelector:(const SEL&)s : (SEL*)s1 {} @end