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
121 lines
3.7 KiB
C++
121 lines
3.7 KiB
C++
// RUN: %clang_cc1 -emit-llvm -triple i386-linux-gnu %s -o - | FileCheck %s
|
|
// RUN: %clang_cc1 -x c++ -emit-pch -triple i386-linux-gnu -o %t %s
|
|
// RUN: %clang_cc1 -include-pch %t %s -triple i386-linux-gnu -emit-llvm -o - | FileCheck %s
|
|
// expected-no-diagnostics
|
|
|
|
#ifndef HEADER
|
|
#define HEADER
|
|
|
|
/// foo: declarations only
|
|
|
|
[[omp::assume("foo:before1")]] void foo();
|
|
|
|
[[omp::assume("foo:before2")]]
|
|
[[omp::assume("foo:before3")]] void
|
|
foo();
|
|
|
|
/// baz: static function declarations and a definition
|
|
|
|
[[omp::assume("baz:before1")]] static void baz();
|
|
|
|
[[omp::assume("baz:before2")]]
|
|
[[omp::assume("baz:before3")]] static void
|
|
baz();
|
|
|
|
// Definition
|
|
[[omp::assume("baz:def1,baz:def2")]] static void baz() { foo(); }
|
|
|
|
[[omp::assume("baz:after")]] static void baz();
|
|
|
|
/// bar: external function declarations and a definition
|
|
|
|
[[omp::assume("bar:before1")]] void bar();
|
|
|
|
[[omp::assume("bar:before2")]]
|
|
[[omp::assume("bar:before3")]] void
|
|
bar();
|
|
|
|
// Definition
|
|
[[omp::assume("bar:def1,bar:def2")]] void bar() { baz(); }
|
|
|
|
[[omp::assume("bar:after")]] void bar();
|
|
|
|
/// back to foo
|
|
|
|
[[omp::assume("foo:after")]] void foo();
|
|
|
|
/// class tests
|
|
class C {
|
|
[[omp::assume("C:private_method")]] void private_method();
|
|
[[omp::assume("C:private_static")]] static void private_static();
|
|
|
|
public:
|
|
[[omp::assume("C:public_method1")]] void public_method();
|
|
[[omp::assume("C:public_static1")]] static void public_static();
|
|
};
|
|
|
|
[[omp::assume("C:public_method2")]] void C::public_method() {
|
|
private_method();
|
|
}
|
|
|
|
[[omp::assume("C:public_static2")]] void C::public_static() {
|
|
private_static();
|
|
}
|
|
|
|
/// template tests
|
|
template <typename T>
|
|
[[omp::assume("template_func<T>")]] void template_func() {}
|
|
|
|
template <>
|
|
[[omp::assume("template_func<float>")]] void template_func<float>() {}
|
|
|
|
template <>
|
|
void template_func<int>() {}
|
|
|
|
template <typename T>
|
|
struct S {
|
|
[[omp::assume("S<T>::method")]] void method();
|
|
};
|
|
|
|
template <>
|
|
[[omp::assume("S<float>::method")]] void S<float>::method() {}
|
|
|
|
template <>
|
|
void S<int>::method() {}
|
|
|
|
// CHECK: define{{.*}} void @_Z3barv() #0
|
|
// CHECK: define{{.*}} void @_ZL3bazv() #1
|
|
// CHECK: define{{.*}} void @_ZN1C13public_methodEv({{.*}}) #2
|
|
// CHECK: declare{{.*}} void @_ZN1C14private_methodEv({{.*}}) #3
|
|
// CHECK: define{{.*}} void @_ZN1C13public_staticEv() #4
|
|
// CHECK: declare{{.*}} void @_ZN1C14private_staticEv() #5
|
|
// CHECK: define{{.*}} void @_Z13template_funcIfEvv() #6
|
|
// CHECK: define{{.*}} void @_Z13template_funcIiEvv() #7
|
|
// CHECK: define{{.*}} void @_ZN1SIfE6methodEv({{.*}}) #8
|
|
// CHECK: define{{.*}} void @_ZN1SIiE6methodEv({{.*}}) #9
|
|
// CHECK: declare{{.*}} void @_Z3foov() #10
|
|
// CHECK: attributes #0
|
|
// CHECK-SAME: "llvm.assume"="bar:before1,bar:before2,bar:before3,bar:def1,bar:def2"
|
|
// CHECK: attributes #1
|
|
// CHECK-SAME: "llvm.assume"="baz:before1,baz:before2,baz:before3,baz:def1,baz:def2,baz:after"
|
|
// CHECK: attributes #2
|
|
// CHECK-SAME: "llvm.assume"="C:public_method1,C:public_method2"
|
|
// CHECK: attributes #3
|
|
// CHECK-SAME: "llvm.assume"="C:private_method"
|
|
// CHECK: attributes #4
|
|
// CHECK-SAME: "llvm.assume"="C:public_static1,C:public_static2"
|
|
// CHECK: attributes #5
|
|
// CHECK-SAME: "llvm.assume"="C:private_static"
|
|
// CHECK: attributes #6
|
|
// CHECK-SAME: "llvm.assume"="template_func<T>,template_func<float>"
|
|
// CHECK: attributes #7
|
|
// CHECK-SAME: "llvm.assume"="template_func<T>"
|
|
// CHECK: attributes #8
|
|
// CHECK-SAME: "llvm.assume"="S<T>::method,S<float>::method"
|
|
// CHECK: attributes #9
|
|
// CHECK-SAME: "llvm.assume"="S<T>::method"
|
|
// CHECK: attributes #10
|
|
// CHECK-SAME: "llvm.assume"="foo:before1,foo:before2,foo:before3"
|
|
|
|
#endif
|