summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-14 18:01:10 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-14 18:01:10 +0000
commit88c86c270741ef9692d2428532d746346ada7811 (patch)
treef289bb5ce64b337811d0290881f63709853bfe93 /gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c
parent4e9eacabedc9d8f0c6faedd0355f151bc646921f (diff)
downloadgcc-88c86c270741ef9692d2428532d746346ada7811.tar.gz
gcc
* c-parser.c (c_parser_asm_string_literal): Clear warn_overlength_strings. gcc/testsuite * gcc.dg/Woverlength-strings-pedantic-c90-asm.c: New file. * gcc.dg/Woverlength-strings-pedantic-c89-asm.c: New file. * gcc.dg/Woverlength-strings-pedantic-c99-asm.c: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170948 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c')
-rw-r--r--gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c
new file mode 100644
index 00000000000..b5523bc8906
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c
@@ -0,0 +1,48 @@
+/* -Woverlength-strings complains about string constants which are too long
+ for the C standard's "minimum maximum" limits. It is off by default,
+ but implied by -pedantic. */
+
+/* { dg-options "-std=c90 -pedantic" } */
+
+#define TEN " "
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+/* C89's minimum-maximum is 509. */
+__asm__ (HUN HUN HUN HUN HUN TEN);
+
+/* C99's minimum-maximum is 4095. */
+__asm__ (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456");
+
+void
+f (void)
+{
+ /* C89's minimum-maximum is 509. */
+ __asm__ (HUN HUN HUN HUN HUN TEN);
+ __asm__ (HUN HUN HUN HUN HUN TEN : :);
+ __asm__ goto (HUN HUN HUN HUN HUN TEN : : : : label);
+
+ /* C99's minimum-maximum is 4095. */
+ __asm__ (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456");
+ __asm__ (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456" : :);
+ __asm__ goto (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456" : : : : label);
+
+ label: ;
+}
+