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.2 KiB
C++
80 lines
2.2 KiB
C++
// RUN: %clang_cc1 -triple i686-linux-gnu -std=c++20 -emit-llvm %s -disable-llvm-passes -o - | FileCheck %s --check-prefix=CHECK-O0
|
|
// RUN: %clang_cc1 -triple i686-linux-gnu -std=c++20 -emit-llvm %s -O1 -disable-llvm-passes -o - | FileCheck %s
|
|
|
|
// Check that we add an llvm.invariant.start.p0i8 to mark when a global becomes
|
|
// read-only. If globalopt can fold the initializer, it will then mark the
|
|
// variable as constant.
|
|
|
|
// Do not produce markers at -O0.
|
|
// CHECK-O0-NOT: llvm.invariant.start.p0i8
|
|
|
|
struct A {
|
|
A();
|
|
int n;
|
|
};
|
|
|
|
// CHECK: @a ={{.*}} global {{.*}} zeroinitializer
|
|
extern const A a = A();
|
|
|
|
struct A2 {
|
|
A2();
|
|
constexpr ~A2() {}
|
|
int n;
|
|
};
|
|
|
|
// CHECK: @a2 ={{.*}} global {{.*}} zeroinitializer
|
|
extern const A2 a2 = A2();
|
|
|
|
|
|
struct B {
|
|
B();
|
|
mutable int n;
|
|
};
|
|
|
|
// CHECK: @b ={{.*}} global {{.*}} zeroinitializer
|
|
extern const B b = B();
|
|
|
|
struct C {
|
|
C();
|
|
~C();
|
|
int n;
|
|
};
|
|
|
|
// CHECK: @c ={{.*}} global {{.*}} zeroinitializer
|
|
extern const C c = C();
|
|
|
|
int f();
|
|
// CHECK: @d ={{.*}} global i32 0
|
|
extern const int d = f();
|
|
// CHECK: @d2 ={{.*}} addrspace(10) global i32 0
|
|
extern const int __attribute__((address_space(10))) d2 = f();
|
|
|
|
void e() {
|
|
static const A a = A();
|
|
}
|
|
|
|
// CHECK: call void @_ZN1AC1Ev(ptr noundef {{[^,]*}} @a)
|
|
// CHECK: call {{.*}}@llvm.invariant.start.p0(i64 4, ptr @a)
|
|
|
|
// CHECK: call void @_ZN2A2C1Ev(ptr noundef {{[^,]*}} @a2)
|
|
// CHECK: call {{.*}}@llvm.invariant.start.p0(i64 4, ptr @a2)
|
|
|
|
// CHECK: call void @_ZN1BC1Ev(ptr noundef {{[^,]*}} @b)
|
|
// CHECK-NOT: call {{.*}}@llvm.invariant.start.p0(i64 noundef 4, ptr @b)
|
|
|
|
// CHECK: call void @_ZN1CC1Ev(ptr noundef {{[^,]*}} @c)
|
|
// CHECK-NOT: call {{.*}}@llvm.invariant.start.p0(i64 noundef 4, ptr @c)
|
|
|
|
// CHECK: call noundef i32 @_Z1fv(
|
|
// CHECK: store {{.*}}, ptr @d
|
|
// CHECK: call {{.*}}@llvm.invariant.start.p0(i64 4, ptr @d)
|
|
|
|
// CHECK: call noundef i32 @_Z1fv(
|
|
// CHECK: store {{.*}}, ptr addrspace(10) @d2
|
|
// CHECK: call {{.*}}@llvm.invariant.start.p10(i64 4, ptr addrspace(10) @d2)
|
|
|
|
// CHECK-LABEL: define{{.*}} void @_Z1ev(
|
|
// CHECK: call void @_ZN1AC1Ev(ptr noundef {{[^,]*}} @_ZZ1evE1a)
|
|
// CHECK: call {{.*}}@llvm.invariant.start.p0(i64 4, ptr {{.*}}@_ZZ1evE1a)
|
|
// CHECK-NOT: llvm.invariant.end
|