Contents Menu Expand Light mode Dark mode Auto light/dark mode
GNU Compiler Collection Internals 13.0.1 (experimental 20220101) documentation
Logo
GNU Compiler Collection Internals 13.0.1 (experimental 20220101) documentation
  • Copyright
  • Introduction
  • Contributing to GCC Development
  • GCC and Portability
  • Interfacing to GCC Output
  • The GCC low-level runtime library
    • Routines for integer arithmetic
    • Routines for floating point emulation
    • Routines for decimal floating point emulation
    • Routines for fixed-point fractional emulation
    • Language-independent routines for exception handling
    • Miscellaneous runtime library routines
  • Language Front Ends in GCC
  • Source Tree Structure and Build System
    • Configure Terms and History
    • Top Level Source Directory
    • The gcc Subdirectory
      • Subdirectories of gcc
      • Configuration in the gcc Directory
      • Build System in the gcc Directory
      • Makefile Targets
      • Library Source Files and Headers under the gcc Directory
      • Headers Installed by GCC
      • Building Documentation
      • Miscellaneous Documentation
      • Anatomy of a Language Front End
      • Anatomy of a Target Back End
  • Testsuites
    • Idioms Used in Testsuite Code
    • Directives used within DejaGnu tests
      • Syntax and Descriptions of test directives
      • Selecting targets to which a test applies
      • Keywords describing target attributes
      • Features for dg-add-options
      • Variants of dg-require-support
      • Commands for use in dg-final
    • Ada Language Testsuites
    • C Language Testsuites
    • Support for testing link-time optimizations
    • Support for testing gcov
    • Support for testing profile-directed optimizations
    • Support for testing binary compatibility
    • Support for torture testing using multiple options
    • Support for testing GIMPLE passes
    • Support for testing RTL passes
  • Option specification files
    • Option file format
    • Option properties
  • Passes and Files of the Compiler
    • Parsing pass
    • Gimplification pass
    • Pass manager
    • Inter-procedural optimization passes
    • Tree SSA passes
    • RTL passes
    • Optimization info
  • Sizes and offsets as runtime invariants
    • Overview of poly_int
    • Consequences of using poly_int
    • Comparisons involving poly_int
    • Arithmetic on poly_ints
    • Alignment of poly_ints
    • Computing bounds on poly_ints
    • Converting poly_ints
    • Miscellaneous poly_int routines
    • Guidelines for using poly_int
  • GENERIC
    • Deficiencies
    • Overview
    • Types
    • Declarations
    • Attributes in trees
    • Expressions
    • Statements
    • Functions
    • Language-dependent trees
    • C and C++ Trees
  • GIMPLE
    • Tuple representation
    • Class hierarchy of GIMPLE statements
    • GIMPLE instruction set
    • Temporaries
    • Operands
    • Manipulating GIMPLE statements
    • Tuple specific accessors
      • GIMPLE_ASM
      • GIMPLE_ASSIGN
      • GIMPLE_BIND
      • GIMPLE_CALL
      • GIMPLE_CATCH
      • GIMPLE_COND
      • GIMPLE_DEBUG
      • GIMPLE_EH_FILTER
      • GIMPLE_LABEL
      • GIMPLE_GOTO
      • GIMPLE_NOP
      • GIMPLE_OMP_ATOMIC_LOAD
      • GIMPLE_OMP_ATOMIC_STORE
      • GIMPLE_OMP_CONTINUE
      • GIMPLE_OMP_CRITICAL
      • GIMPLE_OMP_FOR
      • GIMPLE_OMP_MASTER
      • GIMPLE_OMP_ORDERED
      • GIMPLE_OMP_PARALLEL
      • GIMPLE_OMP_RETURN
      • GIMPLE_OMP_SECTION
      • GIMPLE_OMP_SECTIONS
      • GIMPLE_OMP_SINGLE
      • GIMPLE_PHI
      • GIMPLE_RESX
      • GIMPLE_RETURN
      • GIMPLE_SWITCH
      • GIMPLE_TRY
      • GIMPLE_WITH_CLEANUP_EXPR
    • GIMPLE sequences
    • Sequence iterators
    • Adding a new GIMPLE statement code
    • Statement and operand traversals
    • Exception Handling
  • Analysis and Optimization of GIMPLE tuples
    • Annotations
    • SSA Operands
    • Alias analysis
    • Memory model
    • Static Single Assignment
  • RTL Representation
    • RTL Object Types
    • RTL Classes and Formats
    • Access to Operands
    • Access to Special Operands
    • Flags in an RTL Expression
    • Machine Modes
    • Constant Expression Types
    • Registers and Memory
    • RTL Expressions for Arithmetic
    • Comparison Operations
    • Bit-Fields
    • Vector Operations
    • Conversions
    • Declarations
    • Side Effect Expressions
    • Embedded Side-Effects on Addresses
    • Assembler Instructions as Expressions
    • Variable Location Debug Information in RTL
    • Insns
    • RTL Representation of Function-Call Insns
    • On-the-Side SSA Form for RTL
    • Structure Sharing Assumptions
    • Reading RTL
  • Control Flow Graph
    • Basic Blocks
    • Edges
    • Profile information
    • Maintaining the CFG
    • Liveness information
  • Analysis and Representation of Loops
    • Loop representation
    • Loop querying
    • Loop manipulation
    • Loop-closed SSA form
    • Scalar evolutions
    • IV analysis on RTL
    • Number of iterations analysis
    • Data Dependency Analysis
  • Machine Descriptions
    • Overview of How the Machine Description is Used
    • Everything about Instruction Patterns
    • Example of define_insn
    • RTL Template
    • Output Templates and Operand Substitution
    • C Statements for Assembler Output
    • Predicates
    • Operand Constraints
    • Standard Pattern Names For Generation
    • When the Order of Patterns Matters
    • Interdependence of Patterns
    • Defining Jump Instruction Patterns
    • Defining Looping Instruction Patterns
    • Canonicalization of Instructions
    • Defining RTL Sequences for Code Generation
    • Defining How to Split Instructions
    • Including Patterns in Machine Descriptions.
    • Machine-Specific Peephole Optimizers
    • Instruction Attributes
    • Conditional Execution
    • RTL Templates Transformations
    • Constant Definitions
    • Iterators
  • Target Description Macros and Functions
    • The Global targetm Variable
    • Controlling the Compilation Driver, gcc
    • Run-time Target Specification
    • Defining data structures for per-function information.
    • Storage Layout
    • Layout of Source Language Data Types
    • Register Usage
    • Register Classes
    • Stack Layout and Calling Conventions
      • Basic Stack Layout
      • Exception Handling Support
      • Specifying How Stack Checking is Done
      • Registers That Address the Stack Frame
      • Eliminating Frame Pointer and Arg Pointer
      • Passing Function Arguments on the Stack
      • Passing Arguments in Registers
      • How Scalar Function Values Are Returned
      • How Large Values Are Returned
      • Caller-Saves Register Allocation
      • Function Entry and Exit
      • Generating Code for Profiling
      • Permitting tail calls
      • Shrink-wrapping separate components
      • Stack smashing protection
      • Miscellaneous register hooks
    • Implementing the Varargs Macros
    • Support for Nested Functions
    • Implicit Calls to Library Routines
    • Addressing Modes
    • Anchored Addresses
    • Condition Code Status
    • Describing Relative Costs of Operations
    • Adjusting the Instruction Scheduler
    • Dividing the Output into Sections (Texts, Data, …)
    • Position Independent Code
    • Defining the Output Assembler Language
      • The Overall Framework of an Assembler File
      • Output of Data
      • Output of Uninitialized Variables
      • Output and Generation of Labels
      • How Initialization Functions Are Handled
      • Macros Controlling Initialization Routines
      • Output of Assembler Instructions
      • Output of Dispatch Tables
      • Assembler Commands for Exception Regions
      • Assembler Commands for Alignment
    • Controlling Debugging Information Format
    • Cross Compilation and Floating Point
    • Mode Switching Instructions
    • Defining target-specific uses of __attribute__
    • Emulating TLS
    • Defining coprocessor specifics for MIPS targets.
    • Parameters for Precompiled Header Validity Checking
    • C++ ABI parameters
    • D ABI parameters
    • Adding support for named address spaces
    • Miscellaneous Parameters
  • Host Configuration
    • Host Common
    • Host Misc
    • Host Filesystem
  • Makefile Fragments
    • Target Makefile Fragments
    • Host Makefile Fragments
  • collect2
  • Standard Header File Directories
  • Memory Management and Type Information
    • The Inside of a GTY(())
    • Support for inheritance
    • Support for user-provided GC marking routines
    • Marking Roots for the Garbage Collector
    • Source Files Containing Type Information
    • How to invoke the garbage collector
    • Troubleshooting the garbage collector
  • Plugins
    • Loading Plugins
    • Plugin API
    • Interacting with the pass manager
    • Interacting with the GCC Garbage Collector
    • Giving information about a plugin
    • Registering custom attributes or pragmas
    • Recording information about pass execution
    • Controlling which passes are being run
    • Keeping track of available passes
    • Building GCC plugins
  • Link Time Optimization
    • Design Overview
    • LTO file sections
    • Using summary information in IPA passes
    • Whole program assumptions, linker plugin and symbol visibilities
    • Internal flags controlling lto1
  • Match and Simplify
    • GIMPLE API
    • The Language
  • Static Analyzer
    • Analyzer Internals
    • Debugging the Analyzer
  • User Experience Guidelines
    • Guidelines for Diagnostics
    • Guidelines for Options
  • Funding Free Software
  • Contributors to GCC
  • GNU GENERAL PUBLIC LICENSE
  • GNU Free Documentation License
  • Indexes and tables
Back to top
Edit this page

Support for testing link-time optimizations#

Tests for link-time optimizations usually require multiple source files that are compiled separately, perhaps with different sets of options. There are several special-purpose test directives used for these tests.

dg-lto-do {do-what-keyword }

do-what-keyword specifies how the test is compiled and whether it is executed. It is one of:

assemble

Compile with -c to produce a relocatable object file.

link

Compile, assemble, and link to produce an executable file.

run

Produce and run an executable file, which is expected to return an exit code of 0.

The default is assemble. That can be overridden for a set of tests by redefining dg-do-what-default within the .exp file for those tests.

Unlike dg-do, dg-lto-do does not support an optional target or xfail list. Use dg-skip-if, dg-xfail-if, or dg-xfail-run-if.

dg-lto-options { { {options } [ {options }] } [ target {selector }]}

This directive provides a list of one or more sets of compiler options to override LTO_OPTIONS. Each test will be compiled and run with each of these sets of options.

dg-extra-ld-options {options [ target {selector }]}

This directive adds options to the linker options used.

dg-suppress-ld-options {options [ target {selector }]}

This directive removes options from the set of linker options used.

Next
Support for testing gcov
Previous
C Language Testsuites
Copyright © 1988-2022 Free Software Foundation, Inc.
Made with Sphinx and @pradyunsg's Furo
Last updated on Nov 08, 2022