This patch updates flang to follow clang's behavior when processing the `-mcode-object-version` option. It is now used to populate an LLVM module flag called `amdhsa_code_object_version` expected by the backend and also updates the driver to add the `--amdhsa-code-object-version` option to the frontend invocation for device compilation of AMDGPU targets.
23 lines
1.3 KiB
Fortran
23 lines
1.3 KiB
Fortran
!REQUIRES: amdgpu-registered-target
|
|
|
|
!RUN: %flang_fc1 -emit-llvm -triple amdgcn-amd-amdhsa -target-cpu gfx908 %s -o - | FileCheck --check-prefix=COV-DEFAULT %s
|
|
!RUN: %flang_fc1 -emit-llvm -triple amdgcn-amd-amdhsa -target-cpu gfx908 -mcode-object-version=none %s -o - | FileCheck --check-prefix=COV-NONE %s
|
|
!RUN: %flang_fc1 -emit-llvm -triple amdgcn-amd-amdhsa -target-cpu gfx908 -mcode-object-version=4 %s -o - | FileCheck --check-prefix=COV-4 %s
|
|
!RUN: %flang_fc1 -emit-llvm -triple amdgcn-amd-amdhsa -target-cpu gfx908 -mcode-object-version=5 %s -o - | FileCheck --check-prefix=COV-5 %s
|
|
!RUN: %flang_fc1 -emit-llvm -triple amdgcn-amd-amdhsa -target-cpu gfx908 -mcode-object-version=6 %s -o - | FileCheck --check-prefix=COV-6 %s
|
|
|
|
!COV-DEFAULT-NOT: !{{.*}} = !{{{.*}}, !"amdhsa_code_object_version", {{.*}}}
|
|
!COV-NONE-NOT: !{{.*}} = !{{{.*}}, !"amdhsa_code_object_version", {{.*}}}
|
|
|
|
!COV-4: !llvm.module.flags = !{{{.*}}, ![[COV_FLAG:.*]]}
|
|
!COV-4: ![[COV_FLAG]] = !{i32 1, !"amdhsa_code_object_version", i32 400}
|
|
|
|
!COV-5: !llvm.module.flags = !{{{.*}}, ![[COV_FLAG:.*]]}
|
|
!COV-5: ![[COV_FLAG]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
|
|
|
|
!COV-6: !llvm.module.flags = !{{{.*}}, ![[COV_FLAG:.*]]}
|
|
!COV-6: ![[COV_FLAG]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
|
|
|
|
subroutine target_simple
|
|
end subroutine
|