diff options
Diffstat (limited to 'tests/preprocessor')
| -rw-r--r-- | tests/preprocessor/file-identity/b.h | 7 | ||||
| -rw-r--r-- | tests/preprocessor/file-identity/c.h | 7 | ||||
| -rw-r--r-- | tests/preprocessor/include-a.slang.h | 5 | ||||
| -rw-r--r-- | tests/preprocessor/include-multiple.slang.expected | 8 | ||||
| -rw-r--r-- | tests/preprocessor/output-includes.slang.expected | 8 | ||||
| -rw-r--r-- | tests/preprocessor/pragma-once-a.h | 5 |
6 files changed, 26 insertions, 14 deletions
diff --git a/tests/preprocessor/file-identity/b.h b/tests/preprocessor/file-identity/b.h index ba131c653..c6b731349 100644 --- a/tests/preprocessor/file-identity/b.h +++ b/tests/preprocessor/file-identity/b.h @@ -3,9 +3,12 @@ #include "c.h" #ifdef B_H -# error "Shouldn't be included twice" +#error "Shouldn't be included twice" #endif #define B_H -float foo(float x) { return x; }
\ No newline at end of file +float foo(float x) +{ + return x; +}
\ No newline at end of file diff --git a/tests/preprocessor/file-identity/c.h b/tests/preprocessor/file-identity/c.h index eb6cd1c42..bb8e1c698 100644 --- a/tests/preprocessor/file-identity/c.h +++ b/tests/preprocessor/file-identity/c.h @@ -3,9 +3,12 @@ #include "b.h" #ifdef C_H -# error "c.h shouldn't be included twice" +#error "c.h shouldn't be included twice" #endif #define C_H -float bar(float x) { return x; }
\ No newline at end of file +float bar(float x) +{ + return x; +}
\ No newline at end of file diff --git a/tests/preprocessor/include-a.slang.h b/tests/preprocessor/include-a.slang.h index 8fecc6a98..6e2012874 100644 --- a/tests/preprocessor/include-a.slang.h +++ b/tests/preprocessor/include-a.slang.h @@ -1,3 +1,6 @@ // #include support -int bar() { return foo(); }
\ No newline at end of file +int bar() +{ + return foo(); +}
\ No newline at end of file diff --git a/tests/preprocessor/include-multiple.slang.expected b/tests/preprocessor/include-multiple.slang.expected index f9facb349..cf952be02 100644 --- a/tests/preprocessor/include-multiple.slang.expected +++ b/tests/preprocessor/include-multiple.slang.expected @@ -1,16 +1,16 @@ result code = -1 standard error = { tests/preprocessor/include-a.slang.h(3): error 30201: function 'bar' already has a body -int bar() { return foo(); } +int bar() ^~~ tests/preprocessor/include-a.slang.h(3): note: see previous definition of 'bar' -int bar() { return foo(); } +int bar() ^~~ tests/preprocessor/include-a.slang.h(3): error 30201: function 'bar' already has a body -int bar() { return foo(); } +int bar() ^~~ tests/preprocessor/include-a.slang.h(3): note: see previous definition of 'bar' -int bar() { return foo(); } +int bar() ^~~ } standard output = { diff --git a/tests/preprocessor/output-includes.slang.expected b/tests/preprocessor/output-includes.slang.expected index f2fbb64f2..e34ecee88 100644 --- a/tests/preprocessor/output-includes.slang.expected +++ b/tests/preprocessor/output-includes.slang.expected @@ -7,16 +7,16 @@ standard error = { (0): note: include 'tests/preprocessor/include-a.slang.h' (0): note: include 'tests/preprocessor/include-a.slang.h' tests/preprocessor/include-a.slang.h(3): error 30201: function 'bar' already has a body -int bar() { return foo(); } +int bar() ^~~ tests/preprocessor/include-a.slang.h(3): note: see previous definition of 'bar' -int bar() { return foo(); } +int bar() ^~~ tests/preprocessor/include-a.slang.h(3): error 30201: function 'bar' already has a body -int bar() { return foo(); } +int bar() ^~~ tests/preprocessor/include-a.slang.h(3): note: see previous definition of 'bar' -int bar() { return foo(); } +int bar() ^~~ } standard output = { diff --git a/tests/preprocessor/pragma-once-a.h b/tests/preprocessor/pragma-once-a.h index 6601919e4..e56b13dee 100644 --- a/tests/preprocessor/pragma-once-a.h +++ b/tests/preprocessor/pragma-once-a.h @@ -3,4 +3,7 @@ // Used by the `pragma-once.slang` test -float foo(float x) { return x; } +float foo(float x) +{ + return x; +} |
