@@ -114,6 +114,7 @@ def test_by_default_no_cmake_options(self):
114114 '-DSWIFT_STDLIB_BUILD_PRIVATE:BOOL=TRUE' ,
115115 '-DSWIFT_STDLIB_ENABLE_UNICODE_DATA=TRUE' ,
116116 '-DSWIFT_TOOLS_LD64_LTO_CODEGEN_ONLY_FOR_SUPPORTING_TARGETS:BOOL=FALSE' ,
117+ '-USWIFT_DEBUGINFO_NON_LTO_ARGS'
117118 ]
118119 self .assertEqual (set (swift .cmake_options ), set (expected ))
119120
@@ -144,6 +145,7 @@ def test_swift_runtime_tsan(self):
144145 '-DSWIFT_STDLIB_BUILD_PRIVATE:BOOL=TRUE' ,
145146 '-DSWIFT_STDLIB_ENABLE_UNICODE_DATA=TRUE' ,
146147 '-DSWIFT_TOOLS_LD64_LTO_CODEGEN_ONLY_FOR_SUPPORTING_TARGETS:BOOL=FALSE' ,
148+ '-USWIFT_DEBUGINFO_NON_LTO_ARGS'
147149 ]
148150 self .assertEqual (set (swift .cmake_options ), set (flags_set ))
149151
@@ -497,3 +499,49 @@ def test_swift_tools_ld64_lto_codegen_only_for_supporting_targets(self):
497499 'TRUE' ],
498500 [x for x in swift .cmake_options
499501 if 'SWIFT_TOOLS_LD64_LTO_CODEGEN_ONLY_FOR_SUPPORTING_TARGETS' in x ])
502+
503+ def test_swift_debuginfo_non_lto_args (self ):
504+ self .args .swift_debuginfo_non_lto_args = None
505+ swift = Swift (
506+ args = self .args ,
507+ toolchain = self .toolchain ,
508+ source_dir = '/path/to/src' ,
509+ build_dir = '/path/to/build' )
510+ self .assertIn (
511+ '-USWIFT_DEBUGINFO_NON_LTO_ARGS' ,
512+ swift .cmake_options )
513+
514+ self .args .swift_debuginfo_non_lto_args = []
515+ swift = Swift (
516+ args = self .args ,
517+ toolchain = self .toolchain ,
518+ source_dir = '/path/to/src' ,
519+ build_dir = '/path/to/build' )
520+ self .assertEqual (
521+ ['-DSWIFT_DEBUGINFO_NON_LTO_ARGS:STRING=' ],
522+ [x for x in swift .cmake_options
523+ if 'SWIFT_DEBUGINFO_NON_LTO_ARGS' in x ])
524+
525+ self .args .swift_debuginfo_non_lto_args = ['-g' ]
526+ swift = Swift (
527+ args = self .args ,
528+ toolchain = self .toolchain ,
529+ source_dir = '/path/to/src' ,
530+ build_dir = '/path/to/build' )
531+ self .assertEqual (
532+ ['-DSWIFT_DEBUGINFO_NON_LTO_ARGS:STRING='
533+ '-g' ],
534+ [x for x in swift .cmake_options
535+ if 'SWIFT_DEBUGINFO_NON_LTO_ARGS' in x ])
536+
537+ self .args .swift_debuginfo_non_lto_args = ['-gline-tables-only' , '-v' ]
538+ swift = Swift (
539+ args = self .args ,
540+ toolchain = self .toolchain ,
541+ source_dir = '/path/to/src' ,
542+ build_dir = '/path/to/build' )
543+ self .assertEqual (
544+ ['-DSWIFT_DEBUGINFO_NON_LTO_ARGS:STRING='
545+ '-gline-tables-only;-v' ],
546+ [x for x in swift .cmake_options
547+ if 'SWIFT_DEBUGINFO_NON_LTO_ARGS' in x ])
0 commit comments