summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/arm-asm-warn.c
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-25 23:28:48 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-25 23:28:48 +0000
commit9d1ee1175de34aca8fce8cdca268e7a3287327ed (patch)
tree41ca6a12ed50d989909f749c13c3f2cb503175a4 /clang/test/CodeGen/arm-asm-warn.c
parent3750e7776bb6fd102fb6b351feadcfebd1659ff3 (diff)
downloadbcm5719-llvm-9d1ee1175de34aca8fce8cdca268e7a3287327ed.tar.gz
bcm5719-llvm-9d1ee1175de34aca8fce8cdca268e7a3287327ed.zip
Recommit Eric's code to validate ASM string's constraints and modifiers.
This code checks the ASM string to see if the output size is able to fit within the variable specified as the output. For instance, scalar-to-vector conversions may not really work. It's on by default, but can be turned off with a flag if you think you know what you're doing. This is placed under a flag ('-Wasm-operand-widths') and flag group ('-Wasm'). <rdar://problem/12284092> llvm-svn: 166737
Diffstat (limited to 'clang/test/CodeGen/arm-asm-warn.c')
-rw-r--r--clang/test/CodeGen/arm-asm-warn.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/CodeGen/arm-asm-warn.c b/clang/test/CodeGen/arm-asm-warn.c
new file mode 100644
index 00000000000..0c4e97aba0d
--- /dev/null
+++ b/clang/test/CodeGen/arm-asm-warn.c
@@ -0,0 +1,18 @@
+// REQUIRES: arm-registered-target
+// RUN: %clang_cc1 -triple armv7 %s -emit-llvm -o /dev/null
+// <rdar://problem/12284092>
+
+typedef __attribute__((neon_vector_type(2))) long long int64x2_t;
+typedef struct int64x2x4_t {
+ int64x2_t val[4];
+} int64x2x4_t;
+int64x2x4_t t2(const long long a[]) {
+ int64x2x4_t r;
+ __asm__("vldm %[a], { %q[r0], %q[r1], %q[r2], %q[r3] }"
+ : [r0] "=r"(r.val[0]), // expected-warning {{the size being stored is truncated, use a modifier to specify the size}}
+ [r1] "=r"(r.val[1]), // expected-warning {{the size being stored is truncated, use a modifier to specify the size}}
+ [r2] "=r"(r.val[2]), // expected-warning {{the size being stored is truncated, use a modifier to specify the size}}
+ [r3] "=r"(r.val[3]) // expected-warning {{the size being stored is truncated, use a modifier to specify the size}}
+ : [a] "r"(a));
+ return r;
+}
OpenPOWER on IntegriCloud