no_init_array.carbon 923 B

1234567891011121314151617181920212223
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // ARGS: compile foo.carbon --asm-output --output=- --target=x86_64-linux-gnu -- -fno-use-init-array
  6. //
  7. // NOAUTOUPDATE
  8. // SET-CHECK-SUBSET
  9. // TIP: To test this file alone, run:
  10. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/driver/testdata/compile/target_machine.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/compile/target_machine.carbon
  13. // --- foo.carbon
  14. import Cpp inline '''
  15. int f();
  16. inline int n = f();
  17. ''';
  18. // We should not use init_array, following the command-line flag.
  19. // CHECK:STDOUT: {{\s*}}.section{{\s+}}.ctors,{{.*}}
  20. // CHECK:STDOUT: {{\s*}}.quad{{\s+}}__cxx_global_var_init