diff options
| author | Katalin Rebhan <me@dblsaiko.net> | 2025-02-25 18:52:51 +0100 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-06-05 14:34:27 -0700 |
| commit | 6624e4a896c31ca036fe58def4d8ace4a7776715 (patch) | |
| tree | f34f09d49b3989118e81b3c07c6e4d2d88db6cdf /test cases | |
| parent | 7c84341e7ad2b9bb73eea85fe02ec155ef575128 (diff) | |
| download | meson-6624e4a896c31ca036fe58def4d8ace4a7776715.tar.gz | |
swift: Pass C base compile options to swiftc
Diffstat (limited to 'test cases')
| -rw-r--r-- | test cases/swift/11 c std passthrough/header.h | 10 | ||||
| -rw-r--r-- | test cases/swift/11 c std passthrough/main.swift | 3 | ||||
| -rw-r--r-- | test cases/swift/11 c std passthrough/meson.build | 3 |
3 files changed, 16 insertions, 0 deletions
diff --git a/test cases/swift/11 c std passthrough/header.h b/test cases/swift/11 c std passthrough/header.h new file mode 100644 index 000000000..287cdf4d7 --- /dev/null +++ b/test cases/swift/11 c std passthrough/header.h @@ -0,0 +1,10 @@ +#pragma once + +// let's just assume the default isn't c18. +#if __STDC_VERSION__ == 201710L +typedef struct Datatype { + int x; +} Datatype; +#else +#error C standard version not set! +#endif diff --git a/test cases/swift/11 c std passthrough/main.swift b/test cases/swift/11 c std passthrough/main.swift new file mode 100644 index 000000000..f6358dba1 --- /dev/null +++ b/test cases/swift/11 c std passthrough/main.swift @@ -0,0 +1,3 @@ +let d = Datatype(x: 1) + +precondition(d.x == 1) diff --git a/test cases/swift/11 c std passthrough/meson.build b/test cases/swift/11 c std passthrough/meson.build new file mode 100644 index 000000000..202768fcf --- /dev/null +++ b/test cases/swift/11 c std passthrough/meson.build @@ -0,0 +1,3 @@ +project('c std passthrough', 'swift', 'c', default_options: {'c_std': 'c18'}) + +executable('program', 'main.swift', 'header.h') |
