-S

Purpose

Generates an assembler language file for each source file.

The resulting file has a .s suffix and can be assembled to produce object .o files or an executable file (a.out).

Syntax

Read syntax diagramSkip visual syntax diagram -S

Defaults

Not applicable.

Usage

You can invoke the assembler with any compiler invocation command. For example,
ibm-clang myprogram.s

will invoke the assembler, and if successful, the linker to create an executable file, a.out.

If you specify -S with -E, -E takes precedence. Order of precedence holds regardless of the order in which they were specified on the command line.

You can use the -o option to specify the name of the file produced only if no more than one source file is supplied. For example, the following is not valid:
ibm-clang myprogram1.c myprogram2.c -o -S

Predefined macros

None.

Examples

To compile myprogram.c to produce an assembler language file myprogram.s, enter:
ibm-clang myprogram.c -S
To assemble this program to produce an object file myprogram.o, enter:
ibm-clang myprogram.s -c
To compile myprogram.c to produce an assembler language file asmprogram.s, enter:
ibm-clang myprogram.c -S -o asmprogram.s

Related information