Files
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

67 lines
1.2 KiB
C

// RUN: %clang_cc1 -emit-llvm %s -o %t
/* Sparc is not C99-compliant */
#if defined(sparc) || defined(__sparc__) || defined(__sparcv9)
int main(void) { return 0; }
#else /* sparc */
#define ESCAPE 2
#define IMAGE_WIDTH 150
#define IMAGE_HEIGHT 50
#if 1
#define IMAGE_SIZE 60
#else
#define IMAGE_SIZE 5000
#endif
#define START_X -2.1
#define END_X 1.0
#define START_Y -1.25
#define MAX_ITER 100
#define step_X ((END_X - START_X)/IMAGE_WIDTH)
#define step_Y ((-START_Y - START_Y)/IMAGE_HEIGHT)
#define I 1.0iF
int putchar(char c);
double hypot(double, double);
volatile double __complex__ accum;
void mandel(void) {
int x, y, n;
for (y = 0; y < IMAGE_HEIGHT; ++y) {
for (x = 0; x < IMAGE_WIDTH; ++x) {
double __complex__ c = (START_X+x*step_X) + (START_Y+y*step_Y) * I;
double __complex__ z = 0.0;
for (n = 0; n < MAX_ITER; ++n) {
z = z * z + c;
if (hypot(__real__ z, __imag__ z) >= ESCAPE)
break;
}
if (n == MAX_ITER)
putchar(' ');
else if (n > 6)
putchar('.');
else if (n > 3)
putchar('+');
else if (n > 2)
putchar('x');
else
putchar('*');
}
putchar('\n');
}
}
int main(void) {
mandel();
return 0;
}
#endif /* sparc */