llvm-project/clang/test/SemaObjC/x86-method-vector-values.m
Aaron Ballman 0f1c1be196 [clang] Remove rdar links; NFC
We have a new policy in place making links to private resources
something we try to avoid in source and test files. Normally, we'd
organically switch to the new policy rather than make a sweeping change
across a project. However, Clang is in a somewhat special circumstance
currently: recently, I've had several new contributors run into rdar
links around test code which their patch was changing the behavior of.
This turns out to be a surprisingly bad experience, especially for
newer folks, for a handful of reasons: not understanding what the link
is and feeling intimidated by it, wondering whether their changes are
actually breaking something important to a downstream in some way,
having to hunt down strangers not involved with the patch to impose on
them for help, accidental pressure from asking for potentially private
IP to be made public, etc. Because folks run into these links entirely
by chance (through fixing bugs or working on new features), there's not
really a set of problematic links to focus on -- all of the links have
basically the same potential for causing these problems. As a result,
this is an omnibus patch to remove all such links.

This was not a mechanical change; it was done by manually searching for
rdar, radar, radr, and other variants to find all the various
problematic links. From there, I tried to retain or reword the
surrounding comments so that we would lose as little context as
possible. However, because most links were just a plain link with no
supporting context, the majority of the changes are simple removals.

Differential Review: https://reviews.llvm.org/D158071
2023-08-28 12:13:42 -04:00

124 lines
3.7 KiB
Objective-C

// RUN: %clang_cc1 -verify -DMAC -triple=i686-apple-macosx10.10 -Wno-objc-root-class %s
// RUN: %clang_cc1 -verify -DMAC -triple=i686-apple-macosx10.4 -Wno-objc-root-class %s
// RUN: %clang_cc1 -verify -DMAC -triple=i686-apple-darwin14 -Wno-objc-root-class %s
// RUN: %clang_cc1 -verify -triple=i686-apple-ios8 -Wno-objc-root-class %s
// RUN: %clang_cc1 -verify -DALLOW -DMAC -triple=i686-apple-macosx10.11 -Wno-objc-root-class %s
// RUN: %clang_cc1 -verify -DALLOW -DMAC -triple=i686-apple-darwin15 -Wno-objc-root-class %s
// RUN: %clang_cc1 -verify -DALLOW -DIOS -triple=i686-apple-ios9 -Wno-objc-root-class %s
// RUN: %clang_cc1 -verify -DALLOW -DOTHER -triple=i686-apple-watchos -Wno-objc-root-class %s
// RUN: %clang_cc1 -verify -DALLOW -DOTHER -triple=i686-apple-tvos -Wno-objc-root-class %s
// RUN: %clang_cc1 -verify -DALLOW -DOTHER -triple=x86_64-apple-macosx10.10 -Wno-objc-root-class %s
typedef __attribute__((__ext_vector_type__(3))) float float3;
typedef float __m128 __attribute__((__vector_size__(16)));
struct Aggregate { __m128 v; };
struct AggregateFloat { float v; };
#define AVAILABLE_MACOS_10_10 __attribute__((availability(macos, introduced = 10.10)))
#define AVAILABLE_MACOS_10_11 __attribute__((availability(macos, introduced = 10.11)))
#define AVAILABLE_IOS_8 __attribute__((availability(ios, introduced = 8.0)))
#define AVAILABLE_IOS_9 __attribute__((availability(ios, introduced = 9.0)))
@interface VectorMethods
-(void)takeVector:(float3)v; // there should be no diagnostic at declaration
-(void)takeM128:(__m128)v;
@end
@implementation VectorMethods
#ifndef ALLOW
-(void)takeVector:(float3)v {
#ifdef MAC
// expected-error@-2 {{'float3' (vector of 3 'float' values) parameter type is unsupported; support for vector types for this target is introduced in macOS 10.11}}
#else
// expected-error@-4 {{'float3' (vector of 3 'float' values) parameter type is unsupported; support for vector types for this target is introduced in iOS 9}}
#endif
}
-(float3)retVector { // expected-error {{'float3' (vector of 3 'float' values) return type is unsupported}}
}
-(void)takeVector2:(float3)v AVAILABLE_MACOS_10_10 { // expected-error {{'float3' (vector of 3 'float' values) parameter type is unsupported}}
}
-(void)takeVector3:(float3)v AVAILABLE_MACOS_10_11 { // expected-error {{'float3' (vector of 3 'float' values) parameter type is unsupported}}
}
-(void)takeVector4:(float3)v AVAILABLE_IOS_8 { // expected-error {{'float3' (vector of 3 'float' values) parameter type is unsupported}}
}
-(void)takeVector5:(float3)v AVAILABLE_IOS_9 { // expected-error {{'float3' (vector of 3 'float' values) parameter type is unsupported}}
}
- (__m128)retM128 { // expected-error {{'__m128' (vector of 4 'float' values) return type is unsupported}}
}
- (void)takeM128:(__m128)v { // expected-error {{'__m128' (vector of 4 'float' values) parameter type is unsupported}}
}
#else
// expected-no-diagnostics
-(void)takeVector:(float3)v {
}
-(float3)retVector {
return 0;
}
- (__m128)retM128 {
__m128 value;
return value;
}
- (void)takeM128:(__m128)v {
}
-(void)takeVector2:(float3)v AVAILABLE_MACOS_10_10 {
}
- (__m128)retM128_2 AVAILABLE_MACOS_10_10 {
__m128 value;
return value;
}
-(void)takeVector3:(float3)v AVAILABLE_MACOS_10_11 { // no error
}
-(void)takeVector4:(float3)v AVAILABLE_IOS_8 {
}
-(void)takeVector5:(float3)v AVAILABLE_IOS_9 { // no error
}
#ifdef OTHER
// expected-no-diagnostics
#endif
#endif
-(void)doStuff:(int)m { // no error
}
-(struct Aggregate)takesAndRetVectorInAggregate:(struct Aggregate)f { // no error
struct Aggregate result;
return result;
}
-(struct AggregateFloat)takesAndRetFloatInAggregate:(struct AggregateFloat)f { // no error
struct AggregateFloat result;
return result;
}
@end