CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
80 lines
2.7 KiB
C
80 lines
2.7 KiB
C
// RUN: %clang_cc1 -std=c23 %s -E --embed-dir=%S/Inputs -verify
|
|
// expected-no-diagnostics
|
|
|
|
#if __has_embed(__FILE__) != __STDC_EMBED_FOUND__
|
|
#error 1
|
|
#elif __has_embed("media/art.txt") != __STDC_EMBED_FOUND__
|
|
#error 2
|
|
#elif __has_embed("asdkasdjkadsjkdsfjk") != __STDC_EMBED_NOT_FOUND__
|
|
#error 3
|
|
#elif __has_embed("asdkasdjkadsjkdsfjk" limit(1)) != __STDC_EMBED_NOT_FOUND__
|
|
#error 4
|
|
#elif __has_embed("asdkasdjkadsjkdsfjk" suffix(x) limit(1)) != __STDC_EMBED_NOT_FOUND__
|
|
#error 5
|
|
#elif __has_embed("asdkasdjkadsjkdsfjk" suffix(x) djsakdasjd::xmeow("xD")) != __STDC_EMBED_NOT_FOUND__
|
|
#error 6
|
|
#elif __has_embed(__FILE__ limit(2) prefix(y)) != __STDC_EMBED_FOUND__
|
|
#error 7
|
|
#elif __has_embed(__FILE__ limit(2)) != __STDC_EMBED_FOUND__
|
|
#error 8
|
|
// 6.10.1p7, if the search fails or any of the embed parameters in the embed
|
|
// parameter sequence specified are not supported by the implementation for the
|
|
// #embed directive;
|
|
// We don't support one of the embed parameters.
|
|
#elif __has_embed(__FILE__ dajwdwdjdahwk::meow(x)) != __STDC_EMBED_NOT_FOUND__
|
|
#error 9
|
|
#elif __has_embed(<media/empty>) != __STDC_EMBED_EMPTY__
|
|
#error 10
|
|
// 6.10.1p7: if the search for the resource succeeds and all embed parameters
|
|
// in the embed parameter sequence specified are supported by the
|
|
// implementation for the #embed directive and the resource is empty
|
|
// Limiting to zero characters means the resource is empty.
|
|
#elif __has_embed(<media/empty> limit(0)) != __STDC_EMBED_EMPTY__
|
|
#error 11
|
|
#elif __has_embed(<media/art.txt> limit(0)) != __STDC_EMBED_EMPTY__
|
|
#error 12
|
|
// Test that an offset past the end of the file produces an empty file.
|
|
#elif __has_embed(<single_byte.txt> clang::offset(1)) != __STDC_EMBED_EMPTY__
|
|
#error 13
|
|
// Test that we apply the offset before we apply the limit. If we did this in
|
|
// the reverse order, this would cause the file to be empty because we would
|
|
// have limited it to 1 byte and then offset past it.
|
|
#elif __has_embed(<media/art.txt> limit(1) clang::offset(12)) != __STDC_EMBED_FOUND__
|
|
#error 14
|
|
#elif __has_embed(<media/art.txt>) != __STDC_EMBED_FOUND__
|
|
#error 15
|
|
#elif __has_embed(<media/art.txt> if_empty(meow)) != __STDC_EMBED_FOUND__
|
|
#error 16
|
|
#endif
|
|
|
|
// Ensure that when __has_embed returns true, the file can actually be
|
|
// embedded. This was previously failing because the way in which __has_embed
|
|
// would search for files was differentl from how #embed would resolve them
|
|
// when the file path included relative path markers like `./` or `../`.
|
|
#if __has_embed("./embed___has_embed.c") == __STDC_EMBED_FOUND__
|
|
unsigned char buffer[] = {
|
|
#embed "./embed___has_embed.c"
|
|
};
|
|
#else
|
|
#error 17
|
|
#endif
|
|
|
|
#if __has_embed(__FILE__\
|
|
)
|
|
#else
|
|
#error 18
|
|
#endif
|
|
|
|
#define F __FI\
|
|
LE__
|
|
#if __has_embed(F)
|
|
#else
|
|
#error 19
|
|
#endif
|
|
|
|
#if __has_embed(F\
|
|
)
|
|
#else
|
|
#error 20
|
|
#endif
|