[clang] clang/AMDGPU: Stop passing redundant -target-cpu to cc1 (PR #206483)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 31 07:33:59 PDT 2026


arsenm wrote:

> This break check-flang:
> 
> ```
> FAIL: Flang :: Driver/target-gpu-features.f90 (4588 of 4877)
>   ******************** TEST 'Flang :: Driver/target-gpu-features.f90' FAILED ********************
>   Exit Code: 1
>   
>   Command Output (stdout):
>   --
>   # RUN: at line 6
>   /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang --target=amdgcn-amd-amdhsa -mcpu=gfx902  -nogpulib -c /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/target-gpu-features.f90 -### 2>&1  | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/target-gpu-features.f90 -check-prefix=CHECK-AMDGCN
>   # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang --target=amdgcn-amd-amdhsa -mcpu=gfx902 -nogpulib -c /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/target-gpu-features.f90 '-###'
>   # note: command had no output on stdout or stderr
>   # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/target-gpu-features.f90 -check-prefix=CHECK-AMDGCN
>   # .---command stderr------------
>   # | /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/target-gpu-features.f90:10:22: error: CHECK-AMDGCN-SAME: expected string not found in input
>   # | ! CHECK-AMDGCN-SAME: "-target-cpu" "gfx902"
>   # |                      ^
>   # | <stdin>:6:120: note: scanning from here
>   # |  "/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang-24" "-fc1" "-triple" "amdgpu9.02-amd-amdhsa" "-emit-obj" "-fno-color-diagnostics" "-mrelocation-model" "pic" "-pic-level" "2" "-resource-dir" "/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24" "-mframe-pointer=all" "-o" "target-gpu-features.o" "-x" "f95" "/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/target-gpu-features.f90"
>   # |                                                                                                                        ^
>   # | <stdin>:6:321: note: possible intended match here
>   # |  "/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang-24" "-fc1" "-triple" "amdgpu9.02-amd-amdhsa" "-emit-obj" "-fno-color-diagnostics" "-mrelocation-model" "pic" "-pic-level" "2" "-resource-dir" "/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24" "-mframe-pointer=all" "-o" "target-gpu-features.o" "-x" "f95" "/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/target-gpu-features.f90"
>   # |                                                                                                                                                                                                                                                                                                                                 ^
>   # | 
>   # | Input file: <stdin>
>   # | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/target-gpu-features.f90
>   # | 
>   # | -dump-input=help explains the following input dump.
>   # | 
>   # | Input was:
>   # | <<<<<<
>   # |            1: flang version 24.0.0git (https://github.com/llvm/llvm-project 33e4d0c55c12516e7e4fd47b714fcbe02776710f) 
>   # |            2: Target: amdgcn-amd-amdhsa 
>   # |            3: Thread model: posix 
>   # |            4: InstalledDir: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin 
>   # |            5: Build config: +assertions 
>   # |            6:  "/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang-24" "-fc1" "-triple" "amdgpu9.02-amd-amdhsa" "-emit-obj" "-fno-color-diagnostics" "-mrelocation-model" "pic" "-pic-level" "2" "-resource-dir" "/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24" "-mframe-pointer=all" "-o" "target-gpu-features.o" "-x" "f95" "/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/target-gpu-features.f90" 
>   # | same:10'0                                                                                                                           {                                                                                                                                                                                                                                                                                                                                                   } search range (exclusive bounds)
>   # | same:10'1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 error: no match found in search range
>   # | same:10'2                                                                                                                                                                                                                                                                                                                                     ?                                                                                                                                           possible intended match
>   # | >>>>>>
>   # `-----------------------------
>   # error: command failed with exit status: 1
> ```


Can you just fix the output to match the expectations? It's really broken that the tests do not trigger flang tests on clang changes given it uses the driver, but it's also unreasonable to test flang based on how slow it is 

https://github.com/llvm/llvm-project/pull/206483


More information about the cfe-commits mailing list