diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-06-30 16:39:54 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-07-01 10:22:25 +0300 |
| commit | 3014a0d5f1dcbcfdcec3852ffd54f3c589fe3e83 (patch) | |
| tree | 8e6311a666306be796683feda8b22411752a4f36 /test/cases/compile_errors | |
| parent | 6d24c40b6e79176b05ec735adcecfd346b03f059 (diff) | |
| download | zig-3014a0d5f1dcbcfdcec3852ffd54f3c589fe3e83.tar.gz zig-3014a0d5f1dcbcfdcec3852ffd54f3c589fe3e83.zip | |
Sema: validate callconv
Diffstat (limited to 'test/cases/compile_errors')
11 files changed, 38 insertions, 49 deletions
diff --git a/test/cases/compile_errors/stage1/obj/bogus_compile_var.zig b/test/cases/compile_errors/bogus_compile_var.zig index 845d943c7d..28d8b1dba5 100644 --- a/test/cases/compile_errors/stage1/obj/bogus_compile_var.zig +++ b/test/cases/compile_errors/bogus_compile_var.zig @@ -2,7 +2,7 @@ const x = @import("builtin").bogus; export fn entry() usize { return @sizeOf(@TypeOf(x)); } // error -// backend=stage1 +// backend=stage2 // target=native // -// tmp.zig:1:29: error: container 'builtin' has no member called 'bogus' +// :1:29: error: struct 'builtin.builtin' has no member named 'bogus' diff --git a/test/cases/compile_errors/callconv_apcs_aapcs_aapcsvfp_on_unsupported_platform.zig b/test/cases/compile_errors/callconv_apcs_aapcs_aapcsvfp_on_unsupported_platform.zig new file mode 100644 index 0000000000..cc6fc59a1a --- /dev/null +++ b/test/cases/compile_errors/callconv_apcs_aapcs_aapcsvfp_on_unsupported_platform.zig @@ -0,0 +1,11 @@ +export fn entry1() callconv(.APCS) void {} +export fn entry2() callconv(.AAPCS) void {} +export fn entry3() callconv(.AAPCSVFP) void {} + +// error +// backend=stage2 +// target=x86_64-linux-none +// +// :1:30: error: callconv 'APCS' is only available on ARM, not x86_64 +// :2:30: error: callconv 'AAPCS' is only available on ARM, not x86_64 +// :3:30: error: callconv 'AAPCSVFP' is only available on ARM, not x86_64 diff --git a/test/cases/compile_errors/callconv_interrupt_on_unsupported_platform.zig b/test/cases/compile_errors/callconv_interrupt_on_unsupported_platform.zig new file mode 100644 index 0000000000..5f11fdcfa8 --- /dev/null +++ b/test/cases/compile_errors/callconv_interrupt_on_unsupported_platform.zig @@ -0,0 +1,7 @@ +export fn entry() callconv(.Interrupt) void {} + +// error +// backend=stage2 +// target=aarch64-linux-none +// +// :1:29: error: callconv 'Interrupt' is only available on i386, x86_64, AVR, and MSP430, not aarch64 diff --git a/test/cases/compile_errors/callconv_signal_on_unsupported_platform.zig b/test/cases/compile_errors/callconv_signal_on_unsupported_platform.zig new file mode 100644 index 0000000000..9233655e35 --- /dev/null +++ b/test/cases/compile_errors/callconv_signal_on_unsupported_platform.zig @@ -0,0 +1,7 @@ +export fn entry() callconv(.Signal) void {} + +// error +// backend=stage2 +// target=x86_64-linux-none +// +// :1:29: error: callconv 'Signal' is only available on AVR, not x86_64 diff --git a/test/cases/compile_errors/stage1/obj/callconv_stdcall_fastcall_thiscall_on_unsupported_platform-0.zig b/test/cases/compile_errors/callconv_stdcall_fastcall_thiscall_on_unsupported_platform.zig index f4994107cd..d22fd13e8a 100644 --- a/test/cases/compile_errors/stage1/obj/callconv_stdcall_fastcall_thiscall_on_unsupported_platform-0.zig +++ b/test/cases/compile_errors/callconv_stdcall_fastcall_thiscall_on_unsupported_platform.zig @@ -15,9 +15,9 @@ export fn entry3() void { } // error -// backend=stage1 +// backend=stage2 // target=x86_64-linux-none // -// tmp.zig:1:27: error: callconv 'Stdcall' is only available on x86, not x86_64 -// tmp.zig:2:27: error: callconv 'Fastcall' is only available on x86, not x86_64 -// tmp.zig:3:27: error: callconv 'Thiscall' is only available on x86, not x86_64 +// :1:28: error: callconv 'Stdcall' is only available on i386, not x86_64 +// :2:28: error: callconv 'Fastcall' is only available on i386, not x86_64 +// :3:28: error: callconv 'Thiscall' is only available on i386, not x86_64 diff --git a/test/cases/compile_errors/callconv_vectorcall_on_unsupported_platform.zig b/test/cases/compile_errors/callconv_vectorcall_on_unsupported_platform.zig new file mode 100644 index 0000000000..9c231a6ea8 --- /dev/null +++ b/test/cases/compile_errors/callconv_vectorcall_on_unsupported_platform.zig @@ -0,0 +1,7 @@ +export fn entry() callconv(.Vectorcall) void {} + +// error +// backend=stage2 +// target=x86_64-linux-none +// +// :1:29: error: callconv 'Vectorcall' is only available on i386 and AArch64, not x86_64 diff --git a/test/cases/compile_errors/stage1/obj/callconv_apcs_aapcs_aapcsvfp_on_unsupported_platform.zig b/test/cases/compile_errors/stage1/obj/callconv_apcs_aapcs_aapcsvfp_on_unsupported_platform.zig deleted file mode 100644 index fa06287803..0000000000 --- a/test/cases/compile_errors/stage1/obj/callconv_apcs_aapcs_aapcsvfp_on_unsupported_platform.zig +++ /dev/null @@ -1,11 +0,0 @@ -export fn entry1() callconv(.APCS) void {} -export fn entry2() callconv(.AAPCS) void {} -export fn entry3() callconv(.AAPCSVFP) void {} - -// error -// backend=stage1 -// target=x86_64-linux-none -// -// tmp.zig:1:29: error: callconv 'APCS' is only available on ARM, not x86_64 -// tmp.zig:2:29: error: callconv 'AAPCS' is only available on ARM, not x86_64 -// tmp.zig:3:29: error: callconv 'AAPCSVFP' is only available on ARM, not x86_64 diff --git a/test/cases/compile_errors/stage1/obj/callconv_interrupt_on_unsupported_platform.zig b/test/cases/compile_errors/stage1/obj/callconv_interrupt_on_unsupported_platform.zig deleted file mode 100644 index 8304fb90c1..0000000000 --- a/test/cases/compile_errors/stage1/obj/callconv_interrupt_on_unsupported_platform.zig +++ /dev/null @@ -1,7 +0,0 @@ -export fn entry() callconv(.Interrupt) void {} - -// error -// backend=stage1 -// target=aarch64-linux-none -// -// tmp.zig:1:28: error: callconv 'Interrupt' is only available on x86, x86_64, AVR, and MSP430, not aarch64 diff --git a/test/cases/compile_errors/stage1/obj/callconv_signal_on_unsupported_platform.zig b/test/cases/compile_errors/stage1/obj/callconv_signal_on_unsupported_platform.zig deleted file mode 100644 index 4b19b188fd..0000000000 --- a/test/cases/compile_errors/stage1/obj/callconv_signal_on_unsupported_platform.zig +++ /dev/null @@ -1,7 +0,0 @@ -export fn entry() callconv(.Signal) void {} - -// error -// backend=stage1 -// target=x86_64-linux-none -// -// tmp.zig:1:28: error: callconv 'Signal' is only available on AVR, not x86_64 diff --git a/test/cases/compile_errors/stage1/obj/callconv_stdcall_fastcall_thiscall_on_unsupported_platform-1.zig b/test/cases/compile_errors/stage1/obj/callconv_stdcall_fastcall_thiscall_on_unsupported_platform-1.zig deleted file mode 100644 index aa23f9ae51..0000000000 --- a/test/cases/compile_errors/stage1/obj/callconv_stdcall_fastcall_thiscall_on_unsupported_platform-1.zig +++ /dev/null @@ -1,11 +0,0 @@ -export fn entry1() callconv(.Stdcall) void {} -export fn entry2() callconv(.Fastcall) void {} -export fn entry3() callconv(.Thiscall) void {} - -// error -// backend=stage1 -// target=x86_64-linux-none -// -// tmp.zig:1:29: error: callconv 'Stdcall' is only available on x86, not x86_64 -// tmp.zig:2:29: error: callconv 'Fastcall' is only available on x86, not x86_64 -// tmp.zig:3:29: error: callconv 'Thiscall' is only available on x86, not x86_64 diff --git a/test/cases/compile_errors/stage1/obj/callconv_vectorcall_on_unsupported_platform.zig b/test/cases/compile_errors/stage1/obj/callconv_vectorcall_on_unsupported_platform.zig deleted file mode 100644 index e60e6ab42c..0000000000 --- a/test/cases/compile_errors/stage1/obj/callconv_vectorcall_on_unsupported_platform.zig +++ /dev/null @@ -1,7 +0,0 @@ -export fn entry() callconv(.Vectorcall) void {} - -// error -// backend=stage1 -// target=x86_64-linux-none -// -// tmp.zig:1:28: error: callconv 'Vectorcall' is only available on x86 and AArch64, not x86_64 |
