Files
TheRock/debug-tools/rocgdb/source/gold/testsuite/common_test_1.c
T
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

76 lines
2.3 KiB
C

/* common_test_1.c -- test common symbol sorting
Copyright (C) 2008-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor <iant@google.com>
This file is part of gold.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA.
This is a test of a common symbol in the main program and a
versioned symbol in a shared library. The common symbol in the
main program should override the shared library symbol. */
#include <assert.h>
/* Common symbols should be sorted by size, largest first, and then by
alignment, largest first. We mix up the names, because gas seems
to sort common symbols roughly by name. */
int c9[90];
int c8[80];
int c7[70];
int c6[60];
int c5[10];
int c4[20];
int c3[30];
int c2[40];
int c1[50];
int a1 __attribute__ ((aligned (1 << 9)));
int a2 __attribute__ ((aligned (1 << 8)));
int a3 __attribute__ ((aligned (1 << 7)));
int a4 __attribute__ ((aligned (1 << 6)));
int a5 __attribute__ ((aligned (1 << 1)));
int a6 __attribute__ ((aligned (1 << 2)));
int a7 __attribute__ ((aligned (1 << 3)));
int a8 __attribute__ ((aligned (1 << 4)));
int a9 __attribute__ ((aligned (1 << 5)));
int
main (int argc __attribute__ ((unused)), char** argv __attribute__ ((unused)))
{
assert (&c5[0] > &c4[0]);
assert (&c4[0] > &c3[0]);
assert (&c3[0] > &c2[0]);
assert (&c2[0] > &c1[0]);
assert (&c1[0] > &c6[0]);
assert (&c6[0] > &c7[0]);
assert (&c7[0] > &c8[0]);
assert (&c8[0] > &c9[0]);
assert (&a1 < &a2);
assert (&a2 < &a3);
assert (&a3 < &a4);
assert (&a4 < &a9);
assert (&a9 < &a8);
assert (&a8 < &a7);
assert (&a7 < &a6);
assert (&a6 < &a5);
return 0;
}