| 1 |
// RUN: %clang_cc1 -fpass-by-value-is-noalias -triple arm64-apple-iphoneos -emit-llvm -disable-llvm-optzns -fobjc-runtime-has-weak -fobjc-arc -fobjc-dispatch-method=mixed %s -o - 2>&1 | FileCheck --check-prefix=WITH_NOALIAS %s |
| 2 |
// RUN: %clang_cc1 -triple arm64-apple-iphoneos -emit-llvm -disable-llvm-optzns -fobjc-runtime-has-weak -fobjc-arc -fobjc-dispatch-method=mixed %s -o - 2>&1 | FileCheck --check-prefix=NO_NOALIAS %s |
| 3 |
|
| 4 |
@interface Bar |
| 5 |
@property char value; |
| 6 |
@end |
| 7 |
|
| 8 |
// A struct large enough so it is not passed in registers on ARM64, but with a |
| 9 |
// weak reference, so noalias should not be added even with |
| 10 |
// -fpass-by-value-is-noalias. |
| 11 |
struct Foo { |
| 12 |
int a; |
| 13 |
int b; |
| 14 |
int c; |
| 15 |
int d; |
| 16 |
int e; |
| 17 |
Bar *__weak f; |
| 18 |
}; |
| 19 |
|
| 20 |
// WITH_NOALIAS: define{{.*}} void @take(ptr dead_on_return noundef %arg) |
| 21 |
// NO_NOALIAS: define{{.*}} void @take(ptr dead_on_return noundef %arg) |
| 22 |
void take(struct Foo arg) {} |