Skip to content

[Flang][Lower] NFC: Update target-features/target-cpu tests #80984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions flang/test/Lower/target-features-amdgcn.f90
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
! REQUIRES: amdgpu-registered-target
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes=ALL,NONE
! RUN: %flang_fc1 -emit-fir -triple amdgcn-amd-amdhsa %s -o - | FileCheck %s --check-prefixes=ALL,TRIPLE
! RUN: %flang_fc1 -emit-fir -target-cpu gfx90a %s -o - | FileCheck %s --check-prefixes=ALL,CPU
! RUN: %flang_fc1 -emit-fir -triple amdgcn-amd-amdhsa -target-cpu gfx90a %s -o - | FileCheck %s --check-prefixes=ALL,BOTH
! RUN: %flang_fc1 -emit-fir -triple amdgcn-amd-amdhsa -target-cpu gfx90a %s -o - | FileCheck %s --check-prefixes=ALL,CPU
! RUN: %flang_fc1 -emit-fir -triple amdgcn-amd-amdhsa -target-feature +sse %s -o - | FileCheck %s --check-prefixes=ALL,FEATURE
! RUN: %flang_fc1 -emit-fir -triple amdgcn-amd-amdhsa -target-cpu gfx90a -target-feature +sse %s -o - | FileCheck %s --check-prefixes=ALL,BOTH

! ALL: module attributes {

! NONE-NOT: fir.target_cpu
! NONE-NOT: fir.target_features

! TRIPLE-SAME: fir.target_cpu = "generic-hsa"
! TRIPLE-NOT: fir.target_features

! CPU-SAME: fir.target_cpu = "gfx90a"
! CPU-NOT: fir.target_features
! CPU-SAME: fir.target_features = #llvm.target_features<[
! CPU-SAME: "+gfx90a-insts"
! CPU-SAME: ]>

! FEATURE-SAME: fir.target_features = #llvm.target_features<[
! FEATURE-NOT: "+gfx90a-insts"
! FEATURE-SAME: "+sse"
! FEATURE-SAME: ]>

! BOTH-SAME: fir.target_cpu = "gfx90a"
! BOTH-SAME: fir.target_features = #llvm.target_features<[
! BOTH-SAME: "+gfx90a-insts"
! BOTH-SAME: "+sse"
! BOTH-SAME: ]>
16 changes: 7 additions & 9 deletions flang/test/Lower/target-features-x86_64.f90
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
! REQUIRES: x86-registered-target
! RUN: %flang_fc1 -emit-fir -triple x86_64-unknown-linux-gnu %s -o - | FileCheck %s --check-prefixes=ALL,NONE
! RUN: %flang_fc1 -emit-fir -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o - | FileCheck %s --check-prefixes=ALL,CPU
! RUN: %flang_fc1 -emit-fir -triple x86_64-unknown-linux-gnu -target-feature +sse %s -o - | FileCheck %s --check-prefixes=ALL,FEATURE
! RUN: %flang_fc1 -emit-fir -triple x86_64-unknown-linux-gnu -target-cpu x86-64 -target-feature +sse %s -o - | FileCheck %s --check-prefixes=ALL,BOTH

! ALL: module attributes {

! NONE-NOT: fir.target_cpu
! NONE-NOT: fir.target_features
! CPU-SAME: fir.target_cpu = "x86-64"

! CPU-SAME: fir.target_cpu = "x86-64"
! CPU-NOT: fir.target_features

! FEATURE-NOT: fir.target_cpu
! FEATURE-SAME: fir.target_features = #llvm.target_features<["+sse"]>
! FEATURE-SAME: fir.target_features = #llvm.target_features<[
! FEATURE-SAME: "+sse"
! FEATURE-SAME: ]>

! BOTH-SAME: fir.target_cpu = "x86-64"
! BOTH-SAME: fir.target_features = #llvm.target_features<["+sse"]>
! BOTH-SAME: fir.target_features = #llvm.target_features<[
! BOTH-SAME: "+sse"
! BOTH-SAME: ]>