[PATCH] D93301: [flang][driver] Add support for `-c` and `-emit-obj`

2021-01-07 Thread Andrzej Warzynski via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe5cdb6c56edf: [flang][driver] Add support for `-c` and 
`-emit-obj` (authored by awarzynski).

Changed prior to commit:
  https://reviews.llvm.org/D93301?vs=312457=315081#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93301/new/

https://reviews.llvm.org/D93301

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Flang.cpp
  flang/include/flang/Frontend/FrontendActions.h
  flang/include/flang/Frontend/FrontendOptions.h
  flang/lib/Frontend/CompilerInvocation.cpp
  flang/lib/Frontend/FrontendActions.cpp
  flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
  flang/test/Flang-Driver/code-gen.f90
  flang/test/Flang-Driver/driver-help-hidden.f90
  flang/test/Flang-Driver/driver-help.f90
  flang/test/Flang-Driver/emit-obj.f90
  flang/test/Flang-Driver/phases.f90

Index: flang/test/Flang-Driver/phases.f90
===
--- /dev/null
+++ flang/test/Flang-Driver/phases.f90
@@ -0,0 +1,20 @@
+! RUN: %flang-new -E -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=PP
+! RUN: %flang-new -fsyntax-only -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=COMPILE
+! RUN: %flang-new -c -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=EMIT_OBJ
+
+! REQUIRES: new-flang-driver
+
+! This test verifies the phase control in Flang compiler driver.
+
+! PP: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
+! PP-NEXT: 1: preprocessor, {0}, f95
+
+! COMPILE: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
+! COMPILE-NEXT: 1: preprocessor, {0}, f95
+! COMPILE-NEXT: 2: compiler, {1}, none
+
+! EMIT_OBJ: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
+! EMIT_OBJ-NEXT: 1: preprocessor, {0}, f95
+! EMIT_OBJ-NEXT: 2: compiler, {1}, ir
+! EMIT_OBJ-NEXT: +- 3: backend, {2}, assembler
+! EMIT_OBJ-NEXT: 4: assembler, {3}, object
Index: flang/test/Flang-Driver/emit-obj.f90
===
--- flang/test/Flang-Driver/emit-obj.f90
+++ /dev/null
@@ -1,14 +0,0 @@
-! RUN: not %flang-new  %s 2>&1 | FileCheck %s --check-prefix=ERROR
-! RUN: not %flang-new  -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR
-! RUN: not %flang-new  -fc1 -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR-FC1
-
-! REQUIRES: new-flang-driver
-
-! By default (e.g. when no options like `-E` are passed) flang-new
-! creates a job that corresponds to `-emit-obj`. This option/action is
-! not yet supported. Verify that this is correctly reported as error.
-
-! ERROR: error: unknown argument: '-triple'
-! ERROR: error: unknown argument: '-emit-obj'
-
-! ERROR-FC1: error: unknown argument: '-emit-obj'
Index: flang/test/Flang-Driver/driver-help.f90
===
--- flang/test/Flang-Driver/driver-help.f90
+++ flang/test/Flang-Driver/driver-help.f90
@@ -19,6 +19,7 @@
 ! HELP-EMPTY:
 ! HELP-NEXT:OPTIONS:
 ! HELP-NEXT: -###   Print (but do not run) the commands to run for this compilation
+! HELP-NEXT: -c Only run preprocess, compile, and assemble steps
 ! HELP-NEXT: -D = Define  to  (or 1 if  omitted)
 ! HELP-NEXT: -E Only run the preprocessor
 ! HELP-NEXT: -fcolor-diagnosticsEnable colors in diagnostics
@@ -35,6 +36,7 @@
 ! HELP-FC1-EMPTY:
 ! HELP-FC1-NEXT:OPTIONS:
 ! HELP-FC1-NEXT: -D = Define  to  (or 1 if  omitted)
+! HELP-FC1-NEXT: -emit-obj Emit native object files
 ! HELP-FC1-NEXT: -E Only run the preprocessor
 ! HELP-FC1-NEXT: -help  Display available options
 ! HELP-FC1-NEXT: -o   Write output to 
Index: flang/test/Flang-Driver/driver-help-hidden.f90
===
--- flang/test/Flang-Driver/driver-help-hidden.f90
+++ flang/test/Flang-Driver/driver-help-hidden.f90
@@ -19,6 +19,7 @@
 ! CHECK-EMPTY:
 ! CHECK-NEXT:OPTIONS:
 ! CHECK-NEXT: -###  Print (but do not run) the commands to run for this compilation
+! CHECK-NEXT: -cOnly run preprocess, compile, and assemble steps
 ! CHECK-NEXT: -D = Define  to  (or 1 if  omitted)
 ! CHECK-NEXT: -EOnly run the preprocessor
 ! CHECK-NEXT: -fcolor-diagnosticsEnable colors in diagnostics
Index: flang/test/Flang-Driver/code-gen.f90
===
--- /dev/null
+++ flang/test/Flang-Driver/code-gen.f90
@@ -0,0 +1,15 @@
+! RUN: not %flang-new %s 2>&1 | FileCheck %s --check-prefix=ERROR
+! RUN: not %flang-new -c %s 2>&1 | FileCheck %s --check-prefix=ERROR
+! RUN: not %flang-new -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR
+! RUN: not %flang-new -fc1 -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR
+
+! REQUIRES: new-flang-driver
+
+! Although code-generation is not yet available, we do 

[PATCH] D93301: [flang][driver] Add support for `-c` and `-emit-obj`

2021-01-05 Thread Sourabh Singh Tomar via Phabricator via cfe-commits
SouraVX accepted this revision.
SouraVX added a comment.

LGTM! - Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93301/new/

https://reviews.llvm.org/D93301

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93301: [flang][driver] Add support for `-c` and `-emit-obj`

2021-01-05 Thread Valentin Clement via Phabricator via cfe-commits
clementval accepted this revision.
clementval added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93301/new/

https://reviews.llvm.org/D93301

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93301: [flang][driver] Add support for `-c` and `-emit-obj`

2021-01-04 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski added a comment.

Ping


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93301/new/

https://reviews.llvm.org/D93301

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93301: [flang][driver] Add support for `-c` and `-emit-obj`

2020-12-17 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski updated this revision to Diff 312457.
awarzynski added a comment.

Address PR comments


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93301/new/

https://reviews.llvm.org/D93301

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Flang.cpp
  flang/include/flang/Frontend/FrontendActions.h
  flang/include/flang/Frontend/FrontendOptions.h
  flang/lib/Frontend/CompilerInvocation.cpp
  flang/lib/Frontend/FrontendActions.cpp
  flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
  flang/test/Flang-Driver/code-gen.f90
  flang/test/Flang-Driver/driver-help-hidden.f90
  flang/test/Flang-Driver/driver-help.f90
  flang/test/Flang-Driver/emit-obj.f90
  flang/test/Flang-Driver/phases.f90

Index: flang/test/Flang-Driver/phases.f90
===
--- /dev/null
+++ flang/test/Flang-Driver/phases.f90
@@ -0,0 +1,20 @@
+! RUN: %flang-new -E -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=PP
+! RUN: %flang-new -fsyntax-only -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=COMPILE
+! RUN: %flang-new -c -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=EMIT_OBJ
+
+! REQUIRES: new-flang-driver
+
+! This test verifies the phase control in Flang compiler driver.
+
+! PP: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
+! PP-NEXT: 1: preprocessor, {0}, f95
+
+! COMPILE: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
+! COMPILE-NEXT: 1: preprocessor, {0}, f95
+! COMPILE-NEXT: 2: compiler, {1}, none
+
+! EMIT_OBJ: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
+! EMIT_OBJ-NEXT: 1: preprocessor, {0}, f95
+! EMIT_OBJ-NEXT: 2: compiler, {1}, ir
+! EMIT_OBJ-NEXT: +- 3: backend, {2}, assembler
+! EMIT_OBJ-NEXT: 4: assembler, {3}, object
Index: flang/test/Flang-Driver/emit-obj.f90
===
--- flang/test/Flang-Driver/emit-obj.f90
+++ /dev/null
@@ -1,14 +0,0 @@
-! RUN: not %flang-new  %s 2>&1 | FileCheck %s --check-prefix=ERROR
-! RUN: not %flang-new  -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR
-! RUN: not %flang-new  -fc1 -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR-FC1
-
-! REQUIRES: new-flang-driver
-
-! By default (e.g. when no options like `-E` are passed) flang-new
-! creates a job that corresponds to `-emit-obj`. This option/action is
-! not yet supported. Verify that this is correctly reported as error.
-
-! ERROR: error: unknown argument: '-triple'
-! ERROR: error: unknown argument: '-emit-obj'
-
-! ERROR-FC1: error: unknown argument: '-emit-obj'
Index: flang/test/Flang-Driver/driver-help.f90
===
--- flang/test/Flang-Driver/driver-help.f90
+++ flang/test/Flang-Driver/driver-help.f90
@@ -19,6 +19,7 @@
 ! HELP-EMPTY:
 ! HELP-NEXT:OPTIONS:
 ! HELP-NEXT: -###   Print (but do not run) the commands to run for this compilation
+! HELP-NEXT: -c Only run preprocess, compile, and assemble steps
 ! HELP-NEXT: -E Only run the preprocessor
 ! HELP-NEXT: -fcolor-diagnosticsEnable colors in diagnostics
 ! HELP-NEXT: -fno-color-diagnostics Disable colors in diagnostics
@@ -32,6 +33,7 @@
 ! HELP-FC1:USAGE: flang-new
 ! HELP-FC1-EMPTY:
 ! HELP-FC1-NEXT:OPTIONS:
+! HELP-FC1-NEXT: -emit-obj Emit native object files
 ! HELP-FC1-NEXT: -EOnly run the preprocessor
 ! HELP-FC1-NEXT: -help Display available options
 ! HELP-FC1-NEXT: -o  Write output to 
Index: flang/test/Flang-Driver/driver-help-hidden.f90
===
--- flang/test/Flang-Driver/driver-help-hidden.f90
+++ flang/test/Flang-Driver/driver-help-hidden.f90
@@ -19,6 +19,7 @@
 ! CHECK-EMPTY:
 ! CHECK-NEXT:OPTIONS:
 ! CHECK-NEXT: -###  Print (but do not run) the commands to run for this compilation
+! CHECK-NEXT: -cOnly run preprocess, compile, and assemble steps
 ! CHECK-NEXT: -EOnly run the preprocessor
 ! CHECK-NEXT: -fcolor-diagnosticsEnable colors in diagnostics
 ! CHECK-NEXT: -fno-color-diagnostics Disable colors in diagnostics
Index: flang/test/Flang-Driver/code-gen.f90
===
--- /dev/null
+++ flang/test/Flang-Driver/code-gen.f90
@@ -0,0 +1,15 @@
+! RUN: not %flang-new %s 2>&1 | FileCheck %s --check-prefix=ERROR
+! RUN: not %flang-new -c %s 2>&1 | FileCheck %s --check-prefix=ERROR
+! RUN: not %flang-new -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR
+! RUN: not %flang-new -fc1 -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR
+
+! REQUIRES: new-flang-driver
+
+! Although code-generation is not yet available, we do have frontend actions
+! that correspond to `-c` and `-emit-obj`. For now these actions are just a
+! placeholder and running them leads to a driver error. This test makes sure
+! that these actions are indeed run (rather than `-c` or `-emit-obj` being
+! rejected 

[PATCH] D93301: [flang][driver] Add support for `-c` and `-emit-obj`

2020-12-17 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski marked an inline comment as done.
awarzynski added a comment.

@clementval & @SouraVX - thank you for your comments! I will upload an updated 
version shortly.




Comment at: clang/include/clang/Driver/Options.td:4329
   HelpText<"Generate machine code, but discard output">;
-def emit_obj : Flag<["-"], "emit-obj">,
-  HelpText<"Emit native object files">;

SouraVX wrote:
> Please correct if I've misunderstood this change ?
> You're removing this option from here(`clang`) and  defining again at line 
> 4631 as a common option to both `clang` `flang` ? 
> +1 to that.
> However this seems out of the purview of this patch. Do you think having this 
> as a separate patch(with specific intent) would be good(For 
> tracking/isolating changes) ?
> Or the least you can do is convey this intent in this patch Summary too.
> I'm happy with either of those :)
> You're removing this option from here(clang) and defining again at line 4631 
> as a common option to both clang flang ? 
Correct :)

> However this seems out of the purview of this patch.
Not quite. Without this change you will get an error when using `-emit-obj`:
```
bin/flang-new -fc1 -emit-obj file.f90
error: unknown argument: '-emit-obj'
```
That's because it wouldn't be parsed here: 
https://github.com/llvm/llvm-project/blob/eba09a2db9eab46832cb7ec7ef0d2c227747772a/flang/lib/Frontend/CompilerInvocation.cpp#L166-L167
(note the definition of `includedFlagsBitmask`). 

I do agree that the Summary should be updated, thanks for pointing that out!



Comment at: clang/include/clang/Driver/Options.td:4629
 
-} // let Flags = [CC1Option]
+} // let Flags = [CC1Option, NoDriverOption]
+

clementval wrote:
> Is it intended to modify the SYCL options? 
This is just updating the comment (so it's just an nfc, SYCL options are not 
affected). 

This closing `}` corresponds to the opening `{` specified here:: 
https://github.com/llvm/llvm-project/blob/eba09a2db9eab46832cb7ec7ef0d2c227747772a/clang/include/clang/Driver/Options.td#L4040.
 So, currently we have this:

```
let Flags = [CC1Option, NoDriverOption] in {
// A lot of code HERE
} // let Flags = [CC1Option]
```

Instead it should be:
```
let Flags = [CC1Option, NoDriverOption] in {
// A lot of code HERE
} // let Flags = [CC1Option, NoDriverOption]
```

I was mislead by this comment while working on this patch, so to me it seemed 
like a _related_ change :) But it isn't and should be extracted into a separate 
patch: 
https://github.com/llvm/llvm-project/commit/7f19712a6a9e65bdc9a9843ea488030bc12f3acc.



Comment at: flang/lib/Frontend/CompilerInvocation.cpp:104
   // TODO:
   // case clang::driver::options::OPT_emit_obj:
   // case calng::driver::options::OPT_emit_llvm:

clementval wrote:
> Should you remove this line since you have the case for it?
Yes, thanks for pointing out!



Comment at: flang/test/Flang-Driver/code-gen.f90:15
+
+! CHECK: code-generation is not available yet

SouraVX wrote:
> Since it's an `error` NOT a string(or similar) generated, I would rather have 
> `ERROR` as a string check. This way it is self-evident for end reader.
> Sort of:
> ```! ERROR: code-generation is not available yet```
> 
Yeah, `ERROR` would be better. I wish that we had a prospect of Clang's 
`-verify`. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93301/new/

https://reviews.llvm.org/D93301

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93301: [flang][driver] Add support for `-c` and `-emit-obj`

2020-12-15 Thread Sourabh Singh Tomar via Phabricator via cfe-commits
SouraVX added a comment.

Thanks! for the patch, some minor comments inlined. Rest LGTM. Let others also 
have a look.




Comment at: clang/include/clang/Driver/Options.td:4329
   HelpText<"Generate machine code, but discard output">;
-def emit_obj : Flag<["-"], "emit-obj">,
-  HelpText<"Emit native object files">;

Please correct if I've misunderstood this change ?
You're removing this option from here(`clang`) and  defining again at line 4631 
as a common option to both `clang` `flang` ? 
+1 to that.
However this seems out of the purview of this patch. Do you think having this 
as a separate patch(with specific intent) would be good(For tracking/isolating 
changes) ?
Or the least you can do is convey this intent in this patch Summary too.
I'm happy with either of those :)



Comment at: flang/test/Flang-Driver/code-gen.f90:15
+
+! CHECK: code-generation is not available yet

Since it's an `error` NOT a string(or similar) generated, I would rather have 
`ERROR` as a string check. This way it is self-evident for end reader.
Sort of:
```! ERROR: code-generation is not available yet```



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93301/new/

https://reviews.llvm.org/D93301

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93301: [flang][driver] Add support for `-c` and `-emit-obj`

2020-12-15 Thread Valentin Clement via Phabricator via cfe-commits
clementval added inline comments.



Comment at: clang/include/clang/Driver/Options.td:4629
 
-} // let Flags = [CC1Option]
+} // let Flags = [CC1Option, NoDriverOption]
+

Is it intended to modify the SYCL options? 



Comment at: flang/lib/Frontend/CompilerInvocation.cpp:104
   // TODO:
   // case clang::driver::options::OPT_emit_obj:
   // case calng::driver::options::OPT_emit_llvm:

Should you remove this line since you have the case for it?



Comment at: flang/test/Flang-Driver/code-gen.f90:11
+! placeholder and running them leads to a driver error. This test makes sure
+! that these actions are indeed run (rather then `-c` or `-emit-obj` being
+! rejected earlier).

than instead of then? 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93301/new/

https://reviews.llvm.org/D93301

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93301: [flang][driver] Add support for `-c` and `-emit-obj`

2020-12-15 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski added a comment.

@dang , I would appreciate if you could take a look at the diff in Options.td - 
you introduced the most recent changes there: https://reviews.llvm.org/D82574. 
I got a bit confused with the nested `let` statements there. I couldn't find a 
better way of marking `-emit-obj` as a both `CC1Option` and `FC1Option`, so I 
just extracted it out.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93301/new/

https://reviews.llvm.org/D93301

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93301: [flang][driver] Add support for `-c` and `-emit-obj`

2020-12-15 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski created this revision.
Herald added a reviewer: sscalpone.
Herald added a subscriber: dang.
awarzynski requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch adds a frontend action for emitting object files. While Flang
does not support code-generation, this action remains a placeholder.
This patch simply provides glue-code to connect the compiler driver
with the appropriate frontend action.

The new action is triggered with the `-c` compiler driver flag, i.e.
`flang-new -c`. This is then translated to `flang-new -fc1 -emit-obj`,
so `-emit-obj` has to be marked as supported as well.

As code-generation is not available yet, `flang-new -c` results in a
driver error:

  error: code-generation is not available yet

Hopefully this will help communicating the level of available
functionality within Flang.

I also commented out `-triple` in Flang::ConstructJob and updated some
comments there. This is similar to https://reviews.llvm.org/D93027. I
wanted to make sure that it's clear that we can't support `-triple`
until we have code-generation. However, once code-generation is
available we _will need_ `-triple`.

As this patch adds `-emit-obj`, the emit-obj.f90 becomes irrelevant and
is deleted. Instead, phases.f90 is added to demonstrate that users can
control compilation phases (indeed, `-c` is a phase control flag).

Depends on: D92854 


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93301

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Flang.cpp
  flang/include/flang/Frontend/FrontendActions.h
  flang/include/flang/Frontend/FrontendOptions.h
  flang/lib/Frontend/CompilerInvocation.cpp
  flang/lib/Frontend/FrontendActions.cpp
  flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
  flang/test/Flang-Driver/code-gen.f90
  flang/test/Flang-Driver/driver-help-hidden.f90
  flang/test/Flang-Driver/driver-help.f90
  flang/test/Flang-Driver/emit-obj.f90
  flang/test/Flang-Driver/phases.f90

Index: flang/test/Flang-Driver/phases.f90
===
--- /dev/null
+++ flang/test/Flang-Driver/phases.f90
@@ -0,0 +1,20 @@
+! RUN: %flang-new -E -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=PP
+! RUN: %flang-new -fsyntax-only -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=COMPILE
+! RUN: %flang-new -c -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=EMIT_OBJ
+
+! REQUIRES: new-flang-driver
+
+! This test verifies the phase control in Flang compiler driver.
+
+! PP: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
+! PP-NEXT: 1: preprocessor, {0}, f95
+
+! COMPILE: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
+! COMPILE-NEXT: 1: preprocessor, {0}, f95
+! COMPILE-NEXT: 2: compiler, {1}, none
+
+! EMIT_OBJ: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
+! EMIT_OBJ-NEXT: 1: preprocessor, {0}, f95
+! EMIT_OBJ-NEXT: 2: compiler, {1}, ir
+! EMIT_OBJ-NEXT: +- 3: backend, {2}, assembler
+! EMIT_OBJ-NEXT: 4: assembler, {3}, object
Index: flang/test/Flang-Driver/emit-obj.f90
===
--- flang/test/Flang-Driver/emit-obj.f90
+++ /dev/null
@@ -1,14 +0,0 @@
-! RUN: not %flang-new  %s 2>&1 | FileCheck %s --check-prefix=ERROR
-! RUN: not %flang-new  -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR
-! RUN: not %flang-new  -fc1 -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR-FC1
-
-! REQUIRES: new-flang-driver
-
-! By default (e.g. when no options like `-E` are passed) flang-new
-! creates a job that corresponds to `-emit-obj`. This option/action is
-! not yet supported. Verify that this is correctly reported as error.
-
-! ERROR: error: unknown argument: '-triple'
-! ERROR: error: unknown argument: '-emit-obj'
-
-! ERROR-FC1: error: unknown argument: '-emit-obj'
Index: flang/test/Flang-Driver/driver-help.f90
===
--- flang/test/Flang-Driver/driver-help.f90
+++ flang/test/Flang-Driver/driver-help.f90
@@ -19,6 +19,7 @@
 ! HELP-EMPTY:
 ! HELP-NEXT:OPTIONS:
 ! HELP-NEXT: -###   Print (but do not run) the commands to run for this compilation
+! HELP-NEXT: -c Only run preprocess, compile, and assemble steps
 ! HELP-NEXT: -E Only run the preprocessor
 ! HELP-NEXT: -fcolor-diagnosticsEnable colors in diagnostics
 ! HELP-NEXT: -fno-color-diagnostics Disable colors in diagnostics
@@ -32,6 +33,7 @@
 ! HELP-FC1:USAGE: flang-new
 ! HELP-FC1-EMPTY:
 ! HELP-FC1-NEXT:OPTIONS:
+! HELP-FC1-NEXT: -emit-obj Emit native object files
 ! HELP-FC1-NEXT: -EOnly run the preprocessor
 ! HELP-FC1-NEXT: -help Display available options
 ! HELP-FC1-NEXT: -o  Write output to 
Index: flang/test/Flang-Driver/driver-help-hidden.f90
===
---