Skip to content

Add a test for a compiler crasher with -O -whole-module-optimization -sanitize=address #21385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions test/Interpreter/asan-globals-overwrite.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// RUN: %target-build-swift -O -whole-module-optimization -sanitize=address %s -o %t
// RUN: %target-codesign %t
// RUN: %target-run %t
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is %target-run-simple-swift(-O -whole-module-optimization -sanitize=address).


// REQUIRES: executable_test
// REQUIRES: objc_interop
Copy link
Contributor

@yln yln Feb 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUIRES: foundation (instead of objc_interop)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably needs REQUIRES: asan_runtime if we are actually going to run.


import Foundation

struct MyStruct {
let value = Data()
}

class MyClass: NSObject {
var x: Int = {
_ = MyStruct()
return 0
}()
}