URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
149 |
jeremybenn |
/* Test for format attributes: test use of __attribute__
|
2 |
|
|
in prefix attributes. */
|
3 |
|
|
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
|
4 |
|
|
/* { dg-do compile } */
|
5 |
|
|
/* { dg-options "-std=gnu99 -Wformat" } */
|
6 |
|
|
|
7 |
|
|
#include "format.h"
|
8 |
|
|
|
9 |
|
|
extern __attribute__((format(printf, 1, 2))) void tformatprintf0 (const char *, ...);
|
10 |
|
|
extern void __attribute__((format(printf, 1, 2))) tformatprintf1 (const char *, ...);
|
11 |
|
|
extern void foo (void), __attribute__((format(printf, 1, 2))) tformatprintf2 (const char *, ...);
|
12 |
|
|
extern __attribute__((noreturn)) void bar (void), __attribute__((format(printf, 1, 2))) tformatprintf3 (const char *, ...);
|
13 |
|
|
|
14 |
|
|
void
|
15 |
|
|
baz (int i, int *ip, double d)
|
16 |
|
|
{
|
17 |
|
|
tformatprintf0 ("%d", i);
|
18 |
|
|
tformatprintf0 ("%"); /* { dg-warning "format" "attribute format printf case 0" } */
|
19 |
|
|
tformatprintf1 ("%d", i);
|
20 |
|
|
tformatprintf1 ("%"); /* { dg-warning "format" "attribute format printf case 1" } */
|
21 |
|
|
tformatprintf2 ("%d", i);
|
22 |
|
|
tformatprintf2 ("%"); /* { dg-warning "format" "attribute format printf case 2" } */
|
23 |
|
|
tformatprintf3 ("%d", i);
|
24 |
|
|
tformatprintf3 ("%"); /* { dg-warning "format" "attribute format printf case 3" } */
|
25 |
|
|
}
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.