brintos

brintos / llvm-project-archived public Read only

0
0
Text · 893 B · 86a4ba3 Raw
23 lines · plain
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 %s2// 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 %s3 4@interface Bar5@property char value;6@end7 8// A struct large enough so it is not passed in registers on ARM64, but with a9// weak reference, so noalias should not be added even with10// -fpass-by-value-is-noalias.11struct 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)22void take(struct Foo arg) {}23