Skip to content

Commit af81b4f

Browse files
committed
Reland "[flang][cuda][driver] Make sure flang does not switch to cc1 (#104613)"
Flang is switch to cc1 when we use `-x cuda`. Make sure we can use fc1 with cuda fortran input. The current pipeline will fail at MLIR level for the moment.
1 parent 808933f commit af81b4f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

clang/lib/Driver/Types.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ bool types::isAcceptedByFlang(ID Id) {
170170
case TY_LLVM_IR:
171171
case TY_LLVM_BC:
172172
return true;
173+
case TY_PP_CUDA:
174+
case TY_CUDA:
175+
return true;
173176
}
174177
}
175178

flang/test/Driver/cuda-option.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
! Test -fcuda option
22
! RUN: %flang_fc1 -cpp -x cuda -fdebug-unparse %s -o - | FileCheck %s
3+
! RUN: %flang -cpp -fsyntax-only -x cuda %s -o -
34
! RUN: not %flang_fc1 -cpp %s -o - 2>&1 | FileCheck %s --check-prefix=ERROR
45
program main
56
#if _CUDA
@@ -12,4 +13,4 @@ program main
1213
! CHECK: INTEGER :: var = 1
1314
! CHECK: INTEGER, DEVICE :: dvar
1415

15-
! ERROR: cuda-option.f90:8:19: error: expected end of statement
16+
! ERROR: cuda-option.f90:{{.*}}:{{.*}}: error: expected end of statement

0 commit comments

Comments
 (0)