diff --git a/Tests/Conformance/DOIT3 b/Tests/Conformance/DOIT3 index 9ef8946..f4d1f22 100644 --- a/Tests/Conformance/DOIT3 +++ b/Tests/Conformance/DOIT3 @@ -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 diff --git a/Tests/Conformance/c99pragma.c b/Tests/Conformance/c99pragma.c new file mode 100644 index 0000000..81102a1 --- /dev/null +++ b/Tests/Conformance/c99pragma.c @@ -0,0 +1,23 @@ +/* + * Test _Pragma preprocessing operator (C99). + */ + +#include + +#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"); +} diff --git a/cc.notes b/cc.notes index 62edf0c..fc94e64 100644 --- a/cc.notes +++ b/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 -----------------------------------