brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · ad745b5 Raw
61 lines · plain
1// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -o - %s | FileCheck %s2 3struct TFENode {4void GetURL() const;5};6 7@interface TNodeIconAndNameCell8- (const TFENode&) node;9@end10 11@implementation TNodeIconAndNameCell     12- (const TFENode&) node {13// CHECK: call noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @objc_msgSend14// CHECK-NEXT: call void @_ZNK7TFENode6GetURLEv(ptr {{[^,]*}} %{{.*}})15	self.node.GetURL();16}	// expected-warning {{non-void function does not return a value}}17@end18 19struct X {20  int x;21};22 23void f0(const X &parent);24@interface A25- (const X&) target;26@end27void f1(A *a) {28// CHECK: [[PRP:%.*]] = call noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @objc_msgSend29// CHECK-NEXT:call void @_Z2f0RK1X(ptr noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) [[PRP]])30  f0(a.target);31 32// CHECK: [[MSG:%.*]] = call noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @objc_msgSend33// CHECK-NEXT:call void @_Z2f0RK1X(ptr noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) [[MSG]])34  f0([a target]);35}36 37@interface Test238@property (readonly) int myProperty;39- (int) myProperty;40- (double) myGetter;41@end42void test2() {43    Test2 *obj;44    (void) obj.myProperty; 45    (void) obj.myGetter; 46    static_cast<void>(obj.myProperty);47    static_cast<void>(obj.myGetter);48    void(obj.myProperty);49    void(obj.myGetter);50}51// CHECK-LABEL: define{{.*}} void @_Z5test2v()52// CHECK: call noundef i3253// CHECK: call noundef double54// CHECK: call noundef i3255// CHECK: call noundef double56// CHECK: call noundef i3257// CHECK: call noundef double58 59// PR875160int test3(Test2 *obj) { return obj.myProperty; }61