Files
TheRock/compiler/amd-llvm/clang/test/Frontend/dump-minimization-hints.cpp
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

157 lines
4.1 KiB
C++

// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
// RUN: %clang_cc1 -xc++ -fmodules -fmodule-name=foo -fmodule-map-file=%t/foo.cppmap -emit-module %t/foo.cppmap -o %t/foo.pcm
// RUN: %clang_cc1 -xc++ -fmodules -dump-minimization-hints=%t/decls -fmodule-file=%t/foo.pcm %t/foo.cpp -o %t/foo.o
// RUN: cat %t/decls
// RUN: cat %t/decls | FileCheck -check-prefix=RANGE %s
// RANGE:{
// RANGE-NEXT: "required_ranges": [
// RANGE-NEXT: {
// RANGE-NEXT: "file": "{{.+}}foo.h",
// RANGE-NEXT: "range": [
// RANGE-NEXT: {
// RANGE-NEXT: "from": {
// RANGE-NEXT: "line": 1,
// RANGE-NEXT: "column": 1
// RANGE-NEXT: },
// RANGE-NEXT: "to": {
// RANGE-NEXT: "line": 9,
// RANGE-NEXT: "column": 3
// RANGE-NEXT: }
// RANGE-NEXT: },
// RANGE-NEXT: {
// RANGE-NEXT: "from": {
// RANGE-NEXT: "line": 11,
// RANGE-NEXT: "column": 1
// RANGE-NEXT: },
// RANGE-NEXT: "to": {
// RANGE-NEXT: "line": 11,
// RANGE-NEXT: "column": 25
// RANGE-NEXT: }
// RANGE-NEXT: },
// RANGE-NEXT: {
// RANGE-NEXT: "from": {
// RANGE-NEXT: "line": 13,
// RANGE-NEXT: "column": 1
// RANGE-NEXT: },
// RANGE-NEXT: "to": {
// RANGE-NEXT: "line": 15,
// RANGE-NEXT: "column": 2
// RANGE-NEXT: }
// RANGE-NEXT: },
// RANGE-NEXT: {
// RANGE-NEXT: "from": {
// RANGE-NEXT: "line": 19,
// RANGE-NEXT: "column": 1
// RANGE-NEXT: },
// RANGE-NEXT: "to": {
// RANGE-NEXT: "line": 19,
// RANGE-NEXT: "column": 41
// RANGE-NEXT: }
// RANGE-NEXT: },
// RANGE-NEXT: {
// RANGE-NEXT: "from": {
// RANGE-NEXT: "line": 20,
// RANGE-NEXT: "column": 1
// RANGE-NEXT: },
// RANGE-NEXT: "to": {
// RANGE-NEXT: "line": 23,
// RANGE-NEXT: "column": 2
// RANGE-NEXT: }
// RANGE-NEXT: },
// RANGE-NEXT: {
// RANGE-NEXT: "from": {
// RANGE-NEXT: "line": 31,
// RANGE-NEXT: "column": 1
// RANGE-NEXT: },
// RANGE-NEXT: "to": {
// RANGE-NEXT: "line": 31,
// RANGE-NEXT: "column": 27
// RANGE-NEXT: }
// RANGE-NEXT: },
// RANGE-NEXT: {
// RANGE-NEXT: "from": {
// RANGE-NEXT: "line": 32,
// RANGE-NEXT: "column": 3
// RANGE-NEXT: },
// RANGE-NEXT: "to": {
// RANGE-NEXT: "line": 32,
// RANGE-NEXT: "column": 12
// RANGE-NEXT: }
// RANGE-NEXT: },
// RANGE-NEXT: {
// RANGE-NEXT: "from": {
// RANGE-NEXT: "line": 34,
// RANGE-NEXT: "column": 1
// RANGE-NEXT: },
// RANGE-NEXT: "to": {
// RANGE-NEXT: "line": 34,
// RANGE-NEXT: "column": 2
// RANGE-NEXT: }
// RANGE-NEXT: }
// RANGE-NEXT: ]
// RANGE-NEXT: }
// RANGE-NEXT: ]
// RANGE-NEXT:}
//--- foo.cppmap
module foo {
header "foo.h"
export *
}
//--- foo.h
class MyData {
public:
MyData(int val): value_(val) {}
int getValue() const {
return 5;
}
private:
int value_;
};
extern int global_value;
int multiply(int a, int b) {
return a * b;
}
inline void unused_by_foo() {} // line 17
inline void recursively_used_by_foo() {} // line 19
inline int used_by_foo() { // line 20
recursively_used_by_foo();
return 1;
}
struct UnusedByFoo {};
namespace ns_unused_by_foo {
void x();
}
namespace ns_used_by_foo { // line 31
void x(); // line 32
void unused_y();
} // line 34
// Does not have any declarations that are used, so
// will not be marked as used.
namespace ns_used_by_foo {
void unused_z();
}
//--- foo.cpp
#include "foo.h"
int global_value = 5;
int main() {
MyData data(5);
int current_value = data.getValue();
int doubled_value = multiply(current_value, 2);
int final_result = doubled_value + global_value;
used_by_foo();
ns_used_by_foo::x();
}