[PATCH] D82668: [AArch64][SVE] clang: Add missing svbfloat16_t tests

2020-06-29 Thread Cullen Rhodes via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1ef75f53e9e6: [AArch64][SVE] clang: Add missing svbfloat16_t 
tests (authored by c-rhodes).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82668/new/

https://reviews.llvm.org/D82668

Files:
  clang/test/CodeGen/aarch64-sve.c
  clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp
  clang/test/CodeGenCXX/aarch64-sve-typeinfo.cpp
  clang/test/CodeGenObjC/aarch64-sve-types.m
  clang/test/PCH/aarch64-sve-types.c
  clang/test/Sema/aarch64-sve-types.c
  clang/test/SemaObjC/aarch64-sve-types.m

Index: clang/test/SemaObjC/aarch64-sve-types.m
===
--- clang/test/SemaObjC/aarch64-sve-types.m
+++ clang/test/SemaObjC/aarch64-sve-types.m
@@ -18,5 +18,7 @@
 @property(nullable) __SVFloat32_t f32; // expected-error {{cannot be applied to non-pointer type}}
 @property(nullable) __SVFloat64_t f64; // expected-error {{cannot be applied to non-pointer type}}
 
+@property(nullable) __SVBFloat16_t bf16; // expected-error {{cannot be applied to non-pointer type}}
+
 @property(nullable) __SVBool_t b8; // expected-error {{cannot be applied to non-pointer type}}
 @end
Index: clang/test/Sema/aarch64-sve-types.c
===
--- clang/test/Sema/aarch64-sve-types.c
+++ clang/test/Sema/aarch64-sve-types.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple aarch64-none-linux-gnu -target-feature +sve -fsyntax-only -verify
+// RUN: %clang_cc1 %s -triple aarch64-none-linux-gnu -target-feature +sve,+bf16 -fsyntax-only -verify
 
 void f() {
   int size_s8[sizeof(__SVInt8_t) == 0 ? 1 : -1];// expected-error {{invalid application of 'sizeof' to sizeless type '__SVInt8_t'}}
@@ -34,6 +34,9 @@
   int size_f64[sizeof(__SVFloat64_t) == 0 ? 1 : -1];// expected-error {{invalid application of 'sizeof' to sizeless type '__SVFloat64_t'}}
   int align_f64[__alignof__(__SVFloat64_t) == 16 ? 1 : -1]; // expected-error {{invalid application of '__alignof' to sizeless type '__SVFloat64_t'}}
 
+  int size_bf16[sizeof(__SVBFloat16_t) == 0 ? 1 : -1];// expected-error {{invalid application of 'sizeof' to sizeless type '__SVBFloat16_t'}}
+  int align_bf16[__alignof__(__SVBFloat16_t) == 16 ? 1 : -1]; // expected-error {{invalid application of '__alignof' to sizeless type '__SVBFloat16_t'}}
+
   int size_b8[sizeof(__SVBool_t) == 0 ? 1 : -1];   // expected-error {{invalid application of 'sizeof' to sizeless type '__SVBool_t'}}
   int align_b8[__alignof__(__SVBool_t) == 2 ? 1 : -1]; // expected-error {{invalid application of '__alignof' to sizeless type '__SVBool_t'}}
 }
Index: clang/test/PCH/aarch64-sve-types.c
===
--- clang/test/PCH/aarch64-sve-types.c
+++ clang/test/PCH/aarch64-sve-types.c
@@ -18,4 +18,6 @@
 __SVFloat32_t *f32;
 __SVFloat64_t *f64;
 
+__SVBFloat16_t *bf16;
+
 __SVBool_t *b8;
Index: clang/test/CodeGenObjC/aarch64-sve-types.m
===
--- clang/test/CodeGenObjC/aarch64-sve-types.m
+++ clang/test/CodeGenObjC/aarch64-sve-types.m
@@ -1,7 +1,7 @@
 // RUN: not %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
 // RUN:   2>&1 | FileCheck %s
 // RUN: not %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
-// RUN:   -target-feature +sve 2>&1 | FileCheck %s
+// RUN:   -target-feature +sve,+bf16 2>&1 | FileCheck %s
 
 // CHECK: error: cannot yet @encode type __SVInt8_t
 const char s8[] = @encode(__SVInt8_t);
@@ -28,5 +28,8 @@
 // CHECK: error: cannot yet @encode type __SVFloat64_t
 const char f64[] = @encode(__SVFloat64_t);
 
+// CHECK: error: cannot yet @encode type __SVBFloat16_t
+const char bf16[] = @encode(__SVBFloat16_t);
+
 // CHECK: error: cannot yet @encode type __SVBool_t
 const char b8[] = @encode(__SVBool_t);
Index: clang/test/CodeGenCXX/aarch64-sve-typeinfo.cpp
===
--- clang/test/CodeGenCXX/aarch64-sve-typeinfo.cpp
+++ clang/test/CodeGenCXX/aarch64-sve-typeinfo.cpp
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
 // RUN:   | FileCheck %s
 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
-// RUN:   -target-feature +sve | FileCheck %s
+// RUN:   -target-feature +sve,+bf16 | FileCheck %s
 
 namespace std { class type_info; };
 
@@ -19,6 +19,8 @@
 auto  = typeid(__SVFloat32_t);
 auto  = typeid(__SVFloat64_t);
 
+auto  = typeid(__SVBFloat16_t);
+
 auto  = typeid(__SVBool_t);
 
 // CHECK-DAG: @_ZTSu10__SVInt8_t = {{.*}} c"u10__SVInt8_t\00"
@@ -53,6 +55,9 @@
 
 // CHECK-DAG: @_ZTSu13__SVFloat64_t = {{.*}} c"u13__SVFloat64_t\00"
 // CHECK-DAG: @_ZTIu13__SVFloat64_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}} @_ZTSu13__SVFloat64_t
+//
+// CHECK-DAG: @_ZTSu14__SVBFloat16_t = {{.*}} 

[PATCH] D82668: [AArch64][SVE] clang: Add missing svbfloat16_t tests

2020-06-29 Thread Francesco Petrogalli via Phabricator via cfe-commits
fpetrogalli accepted this revision.
fpetrogalli added a comment.

Ship it! :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82668/new/

https://reviews.llvm.org/D82668



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82668: [AArch64][SVE] clang: Add missing svbfloat16_t tests

2020-06-29 Thread Sander de Smalen via Phabricator via cfe-commits
sdesmalen accepted this revision.
sdesmalen added a comment.
This revision is now accepted and ready to land.

LGTM!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82668/new/

https://reviews.llvm.org/D82668



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82668: [AArch64][SVE] clang: Add missing svbfloat16_t tests

2020-06-29 Thread Cullen Rhodes via Phabricator via cfe-commits
c-rhodes added inline comments.



Comment at: clang/test/CodeGenCXX/aarch64-sve-typeinfo.cpp:4
 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
-// RUN:   -target-feature +sve | FileCheck %s
+// RUN:   -target-feature +sve,+bf16 | FileCheck %s
 

fpetrogalli wrote:
> I wonder if we should keep the bf16 tests separate, as +bf16 is not needed to 
> generate any of the other SVE types. I don't have strong opinions here, but 
> it seems a better thing to do to isolate the bfloat tests in SVE in a 
> separate file. What do you think, @c-rhodes?
> I wonder if we should keep the bf16 tests separate, as +bf16 is not needed to 
> generate any of the other SVE types. I don't have strong opinions here, but 
> it seems a better thing to do to isolate the bfloat tests in SVE in a 
> separate file. What do you think, @c-rhodes?

I don't think either `+sve` or `+bf16` are actually required in any of these 
tests since they're directly using the ACLE types and not including 
`arm_sve.h`. Where I've added `+bf16` I've done so to be consistent, but notice 
there's some tests with no target feature and some that have run lines covering 
both. I'd prefer to keep to tests together.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82668/new/

https://reviews.llvm.org/D82668



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82668: [AArch64][SVE] clang: Add missing svbfloat16_t tests

2020-06-26 Thread Francesco Petrogalli via Phabricator via cfe-commits
fpetrogalli added inline comments.



Comment at: clang/test/CodeGenCXX/aarch64-sve-typeinfo.cpp:4
 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
-// RUN:   -target-feature +sve | FileCheck %s
+// RUN:   -target-feature +sve,+bf16 | FileCheck %s
 

I wonder if we should keep the bf16 tests separate, as +bf16 is not needed to 
generate any of the other SVE types. I don't have strong opinions here, but it 
seems a better thing to do to isolate the bfloat tests in SVE in a separate 
file. What do you think, @c-rhodes?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82668/new/

https://reviews.llvm.org/D82668



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82668: [AArch64][SVE] clang: Add missing svbfloat16_t tests

2020-06-26 Thread Cullen Rhodes via Phabricator via cfe-commits
c-rhodes created this revision.
c-rhodes added reviewers: sdesmalen, kmclaughlin, fpetrogalli.
Herald added subscribers: danielkiss, psnobl, rkruppe, kristof.beyls, tschuett.
Herald added a reviewer: efriedma.
Herald added a project: clang.

Patch adds tests for mangling of svbfloat16_t and several other type
related tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82668

Files:
  clang/test/CodeGen/aarch64-sve.c
  clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp
  clang/test/CodeGenCXX/aarch64-sve-typeinfo.cpp
  clang/test/CodeGenObjC/aarch64-sve-types.m
  clang/test/PCH/aarch64-sve-types.c
  clang/test/Sema/aarch64-sve-types.c
  clang/test/SemaObjC/aarch64-sve-types.m

Index: clang/test/SemaObjC/aarch64-sve-types.m
===
--- clang/test/SemaObjC/aarch64-sve-types.m
+++ clang/test/SemaObjC/aarch64-sve-types.m
@@ -18,5 +18,7 @@
 @property(nullable) __SVFloat32_t f32; // expected-error {{cannot be applied to non-pointer type}}
 @property(nullable) __SVFloat64_t f64; // expected-error {{cannot be applied to non-pointer type}}
 
+@property(nullable) __SVBFloat16_t bf16; // expected-error {{cannot be applied to non-pointer type}}
+
 @property(nullable) __SVBool_t b8; // expected-error {{cannot be applied to non-pointer type}}
 @end
Index: clang/test/Sema/aarch64-sve-types.c
===
--- clang/test/Sema/aarch64-sve-types.c
+++ clang/test/Sema/aarch64-sve-types.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple aarch64-none-linux-gnu -target-feature +sve -fsyntax-only -verify
+// RUN: %clang_cc1 %s -triple aarch64-none-linux-gnu -target-feature +sve,+bf16 -fsyntax-only -verify
 
 void f() {
   int size_s8[sizeof(__SVInt8_t) == 0 ? 1 : -1];// expected-error {{invalid application of 'sizeof' to sizeless type '__SVInt8_t'}}
@@ -34,6 +34,9 @@
   int size_f64[sizeof(__SVFloat64_t) == 0 ? 1 : -1];// expected-error {{invalid application of 'sizeof' to sizeless type '__SVFloat64_t'}}
   int align_f64[__alignof__(__SVFloat64_t) == 16 ? 1 : -1]; // expected-error {{invalid application of '__alignof' to sizeless type '__SVFloat64_t'}}
 
+  int size_bf16[sizeof(__SVBFloat16_t) == 0 ? 1 : -1];// expected-error {{invalid application of 'sizeof' to sizeless type '__SVBFloat16_t'}}
+  int align_bf16[__alignof__(__SVBFloat16_t) == 16 ? 1 : -1]; // expected-error {{invalid application of '__alignof' to sizeless type '__SVBFloat16_t'}}
+
   int size_b8[sizeof(__SVBool_t) == 0 ? 1 : -1];   // expected-error {{invalid application of 'sizeof' to sizeless type '__SVBool_t'}}
   int align_b8[__alignof__(__SVBool_t) == 2 ? 1 : -1]; // expected-error {{invalid application of '__alignof' to sizeless type '__SVBool_t'}}
 }
Index: clang/test/PCH/aarch64-sve-types.c
===
--- clang/test/PCH/aarch64-sve-types.c
+++ clang/test/PCH/aarch64-sve-types.c
@@ -18,4 +18,6 @@
 __SVFloat32_t *f32;
 __SVFloat64_t *f64;
 
+__SVBFloat16_t *bf16;
+
 __SVBool_t *b8;
Index: clang/test/CodeGenObjC/aarch64-sve-types.m
===
--- clang/test/CodeGenObjC/aarch64-sve-types.m
+++ clang/test/CodeGenObjC/aarch64-sve-types.m
@@ -1,7 +1,7 @@
 // RUN: not %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
 // RUN:   2>&1 | FileCheck %s
 // RUN: not %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
-// RUN:   -target-feature +sve 2>&1 | FileCheck %s
+// RUN:   -target-feature +sve,+bf16 2>&1 | FileCheck %s
 
 // CHECK: error: cannot yet @encode type __SVInt8_t
 const char s8[] = @encode(__SVInt8_t);
@@ -28,5 +28,8 @@
 // CHECK: error: cannot yet @encode type __SVFloat64_t
 const char f64[] = @encode(__SVFloat64_t);
 
+// CHECK: error: cannot yet @encode type __SVBFloat16_t
+const char bf16[] = @encode(__SVBFloat16_t);
+
 // CHECK: error: cannot yet @encode type __SVBool_t
 const char b8[] = @encode(__SVBool_t);
Index: clang/test/CodeGenCXX/aarch64-sve-typeinfo.cpp
===
--- clang/test/CodeGenCXX/aarch64-sve-typeinfo.cpp
+++ clang/test/CodeGenCXX/aarch64-sve-typeinfo.cpp
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
 // RUN:   | FileCheck %s
 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
-// RUN:   -target-feature +sve | FileCheck %s
+// RUN:   -target-feature +sve,+bf16 | FileCheck %s
 
 namespace std { class type_info; };
 
@@ -19,6 +19,8 @@
 auto  = typeid(__SVFloat32_t);
 auto  = typeid(__SVFloat64_t);
 
+auto  = typeid(__SVBFloat16_t);
+
 auto  = typeid(__SVBool_t);
 
 // CHECK-DAG: @_ZTSu10__SVInt8_t = {{.*}} c"u10__SVInt8_t\00"
@@ -53,6 +55,9 @@
 
 // CHECK-DAG: @_ZTSu13__SVFloat64_t = {{.*}} c"u13__SVFloat64_t\00"
 // CHECK-DAG: @_ZTIu13__SVFloat64_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}}