Files
TheRock/compiler/amd-llvm/clang/test/CIR/CodeGen/no-common.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

104 lines
4.1 KiB
C

// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir %s -emit-cir -o %t-default.cir
// RUN: FileCheck --input-file=%t-default.cir %s -check-prefix=CIR-DEFAULT
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir %s -fno-common -emit-cir -o %t-no-common.cir
// RUN: FileCheck --input-file=%t-no-common.cir %s -check-prefix=CIR-DEFAULT
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir %s -fcommon -emit-cir -o %t-common.cir
// RUN: FileCheck --input-file=%t-common.cir %s -check-prefix=CIR-COMMON
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir %s -emit-llvm -o %t-default-cir.ll
// RUN: FileCheck --input-file=%t-default-cir.ll %s -check-prefix=LLVM-DEFAULT
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir %s -fno-common -emit-llvm -o %t-no-common-cir.ll
// RUN: FileCheck --input-file=%t-no-common-cir.ll %s -check-prefix=LLVM-DEFAULT
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir %s -fcommon -emit-llvm -o %t-common-cir.ll
// RUN: FileCheck --input-file=%t-common-cir.ll %s -check-prefix=LLVM-COMMON
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu %s -emit-llvm -o %t-default.ll
// RUN: FileCheck --input-file=%t-default.ll %s -check-prefix=OGCG-DEFAULT
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu %s -fno-common -emit-llvm -o %t-no-common.ll
// RUN: FileCheck --input-file=%t-no-common.ll %s -check-prefix=OGCG-DEFAULT
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu %s -fcommon -emit-llvm -o %t-common.ll
// RUN: FileCheck --input-file=%t-common.ll %s -check-prefix=OGCG-COMMON
const int a = 42;
// CIR-DEFAULT: cir.global constant external @a = #cir.int<42>
// LLVM-DEFAULT: @a = constant i32 42
// OGCG-DEFAULT: @a = constant i32 42
// CIR-COMMON: cir.global constant external @a
// LLVM-COMMON: @a = constant i32 42
// OGCG-COMMON: @a = constant i32 42
const int b __attribute__((common)) = 42;
// CIR-DEFAULT: cir.global constant external @b = #cir.int<42>
// LLVM-DEFAULT: @b = constant i32 42
// OGCG-DEFAULT: @b = constant i32 42
// CIR-COMMON: cir.global constant external @b = #cir.int<42>
// LLVM-COMMON: @b = constant i32 42
// OGCG-COMMON: @b = constant i32 42
const int c __attribute__((nocommon)) = 42;
// CIR-DEFAULT: cir.global constant external @c = #cir.int<42>
// LLVM-DEFAULT: @c = constant i32 42
// OGCG-DEFAULT: @c = constant i32 42
// CIR-COMMON: cir.global constant external @c = #cir.int<42>
// LLVM-COMMON: @c = constant i32 42
// OGCG-COMMON: @c = constant i32 42
int d = 11;
// CIR-DEFAULT: cir.global external @d = #cir.int<11>
// LLVM-DEFAULT: @d = global i32 11
// OGCG-DEFAULT: @d = global i32 11
// CIR-COMMON: cir.global external @d = #cir.int<11>
// LLVM-COMMON: @d = global i32 11
// OGCG-COMMON: @d = global i32 11
int e;
// CIR-DEFAULT: cir.global external @e = #cir.int<0>
// LLVM-DEFAULT: @e = global i32 0
// OGCG-DEFAULT: @e = global i32 0
// CIR-COMMON: cir.global common @e = #cir.int<0>
// LLVM-COMMON: @e = common global i32 0
// OGCG-COMMON: @e = common global i32 0
int f __attribute__((common));
// CIR-DEFAULT: cir.global common @f = #cir.int<0>
// LLVM-DEFAULT: @f = common global i32 0
// OGCG-DEFAULT: @f = common global i32 0
// CIR-COMMON: cir.global common @f
// LLVM-COMMON: @f = common global i32 0
// OGCG-COMMON: @f = common global i32 0
int g __attribute__((nocommon));
// CIR-DEFAULT: cir.global external @g = #cir.int<0>
// LLVM-DEFAULT: @g = global i32
// OGCG-DEFAULT: @g = global i32 0
// CIR-COMMON: cir.global external @g = #cir.int<0>
// LLVM-COMMON: @g = global i32 0
// OGCG-COMMON: @g = global i32 0
const int h;
// CIR-DEFAULT: cir.global constant external @h = #cir.int<0>
// LLVM-DEFAULT: @h = constant i32
// OGCG-DEFAULT: @h = constant i32 0
// CIR-COMMON: cir.global common @h = #cir.int<0>
// LLVM-COMMON: @h = common global i32 0
// OGCG-COMMON: @h = common global i32 0
typedef void* (*fn_t)(long a, long b, char *f, int c);
fn_t ABC __attribute__ ((nocommon));
// CIR-DEFAULT: cir.global external @ABC = #cir.ptr<null>
// LLVM-DEFAULT: @ABC = global ptr null
// OGCG-DEFAULT: @ABC = global ptr null
// CIR-COMMON: cir.global external @ABC = #cir.ptr<null>
// LLVM-COMMON: @ABC = global ptr null
// OGCG-COMMON: @ABC = global ptr null