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

74 lines
2.7 KiB
C

// RUN: %clang_cc1 -emit-llvm -triple arm-none-eabi -o - %s | FileCheck %s
// Test interaction between __attribute__((section())) and '#pragma clang
// section' directives. The attribute should always have higher priority than
// the pragma.
// Text tests.
#pragma clang section text=".ext_fun_pragma"
void ext_fun(void) __attribute__((section(".ext_fun_attr")));
void ext_fun(void) {}
#pragma clang section text=""
void ext_fun2(void) __attribute__((section(".ext_fun2_attr")));
#pragma clang section text=".ext_fun2_pragma"
void ext_fun2(void) {}
#pragma clang section text=""
#pragma clang section text=".int_fun_pragma"
static void int_fun(void) __attribute__((section(".int_fun_attr"), used));
static void int_fun(void) {}
#pragma clang section text=""
static void int_fun2(void) __attribute__((section(".int_fun2_attr"), used));
#pragma clang section text=".int_fun2_pragma"
static void int_fun2(void) {}
#pragma clang section text=""
// Rodata tests.
#pragma clang section rodata=".ext_const_pragma"
__attribute__((section(".ext_const_attr")))
const int ext_const = 1;
#pragma clang section rodata=""
#pragma clang section rodata=".int_const_pragma"
__attribute__((section(".int_const_attr"), used))
static const int int_const = 1;
#pragma clang section rodata=""
// Data tests.
#pragma clang section data=".ext_var_pragma"
__attribute__((section(".ext_var_attr")))
int ext_var = 1;
#pragma clang section data=""
#pragma clang section data=".int_var_pragma"
__attribute__((section(".int_var_attr"), used))
static int int_var = 1;
#pragma clang section data=""
// Bss tests.
#pragma clang section bss=".ext_zvar_pragma"
__attribute__((section(".ext_zvar_attr")))
int ext_zvar;
#pragma clang section bss=""
#pragma clang section bss=".int_zvar_pragma"
__attribute__((section(".int_zvar_attr"), used))
static int int_zvar;
#pragma clang section bss=""
// CHECK: @ext_const ={{.*}} constant i32 1, section ".ext_const_attr", align 4{{$}}
// CHECK: @int_const = internal constant i32 1, section ".int_const_attr", align 4{{$}}
// CHECK: @ext_var ={{.*}} global i32 1, section ".ext_var_attr", align 4{{$}}
// CHECK: @int_var = internal global i32 1, section ".int_var_attr", align 4{{$}}
// CHECK: @ext_zvar ={{.*}} global i32 0, section ".ext_zvar_attr", align 4{{$}}
// CHECK: @int_zvar = internal global i32 0, section ".int_zvar_attr", align 4{{$}}
// CHECK: define{{.*}} void @ext_fun() #0 section ".ext_fun_attr"
// CHECK: define{{.*}} void @ext_fun2() #0 section ".ext_fun2_attr"
// CHECK: define internal void @int_fun() #0 section ".int_fun_attr"
// CHECK: define internal void @int_fun2() #0 section ".int_fun2_attr"
//
// No other attribute group should be present in the file.
// CHECK-NOT: attributes #1