mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-01 13:29:32 +00:00
Add documentation and tests for _Pragma.
This commit is contained in:
parent
e5428b21d2
commit
913052fe7c
@ -22,6 +22,7 @@
|
||||
{1} c99math.c
|
||||
{1} c99fpcmp.c
|
||||
{1} c99tgmath.c
|
||||
{1} c99pragma.c
|
||||
{1} c11generic.c
|
||||
{1} c11align.c
|
||||
{1} c11noret.c
|
||||
|
23
Tests/Conformance/c99pragma.c
Normal file
23
Tests/Conformance/c99pragma.c
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Test _Pragma preprocessing operator (C99).
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#pragma optimize -1
|
||||
#pragma debug -1
|
||||
|
||||
_Pragma("debug 0")
|
||||
|
||||
#define p(x) _Pragma(#x)
|
||||
#define opt(x) p(optimize x)
|
||||
|
||||
void f(int n, ...) {
|
||||
}
|
||||
|
||||
opt(1+2)
|
||||
|
||||
int _Pragma("")main(_Pragma("*#^abcdefg foo bar baz")void) {
|
||||
f(123, 456, 789);
|
||||
printf _Pragma("unrecognized")("Passed Conformance Test c99pragma\n");
|
||||
}
|
14
cc.notes
14
cc.notes
@ -583,6 +583,20 @@ Members of anonymous structures or unions (including nested ones) may be accesse
|
||||
|
||||
The _Thread_local storage-class specifier may be used together with static or extern. This has the normal effect of the other storage-class specifier while also indicating that the variable has thread-local storage. For declarations within a function, _Thread_local must be used together with static or extern.
|
||||
|
||||
29. (C99) ORCA/C now supports the _Pragma preprocessing operator. A token sequence of the form
|
||||
|
||||
_Pragma ( string-literal )
|
||||
|
||||
is processed as if the contents of the string literal were the operands of a #pragma preprocessing directive. For example,
|
||||
|
||||
_Pragma("optimize 1")
|
||||
|
||||
is equivalent to the directive
|
||||
|
||||
#pragma optimize 1
|
||||
|
||||
The _Pragma("...") token sequence may be formed using preprocessor macros.
|
||||
|
||||
|
||||
Multi-Character Character Constants
|
||||
-----------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user