Files
clang-p2996/clang/test/CodeGenObjCXX/references.mm
Nikita Popov 532dc62b90 [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC)
This adds -no-opaque-pointers to clang tests whose output will
change when opaque pointers are enabled by default. This is
intended to be part of the migration approach described in
https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9.

The patch has been produced by replacing %clang_cc1 with
%clang_cc1 -no-opaque-pointers for tests that fail with opaque
pointers enabled. Worth noting that this doesn't cover all tests,
there's a remaining ~40 tests not using %clang_cc1 that will need
a followup change.

Differential Revision: https://reviews.llvm.org/D123115
2022-04-07 12:09:47 +02:00

46 lines
707 B
Plaintext

// RUN: %clang_cc1 -no-opaque-pointers %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
struct A { ~A(); };
@interface B {
A a;
}
- (const A&)getA;
@end
@implementation B
- (const A&)getA {
return a;
}
@end
// CHECK-LABEL: define{{.*}} void @_Z1fP1B
// CHECK: objc_msgSend to
// CHECK-NOT: call void @_ZN1AD1Ev
// CHECK: ret void
void f(B* b) {
(void)[b getA];
}
// PR7741
@protocol P1 @end
@protocol P2 @end
@protocol P3 @end
@interface foo<P1> {} @end
@interface bar : foo <P1, P2, P3> {} @end
typedef bar baz;
void f5(foo&);
void f5b(foo<P1>&);
void f5c(foo<P2>&);
void f5d(foo<P3>&);
void f6(baz* x) {
f5(*x);
f5b(*x);
f5c(*x);
f5d(*x);
(void)((foo&)*x);
}