-
Notifications
You must be signed in to change notification settings - Fork 10.4k
/
Copy pathload-pass-plugin.swift
21 lines (16 loc) · 1.01 KB
/
load-pass-plugin.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// REQUIRES: OS=macosx
// This test fails under ASAN because of an ODR violation (which is strictly
// speaking a bug: https://github.com/swiftlang/swift/issues/77771). Disable
// for ASAN until it's fixed.
// UNSUPPORTED: asan
// RUN: %target-swift-frontend -load-pass-plugin=nonexistent.dylib %s -emit-ir -o /dev/null 2>&1 | %FileCheck -check-prefix=CHECK-UNABLE-LOAD %s
// CHECK-UNABLE-LOAD: error: unable to load plugin 'nonexistent.dylib': 'Could not load library{{.*}}'
// RUN: %empty-directory(%t)
// RUN: %target-clangxx %S/Inputs/TestPlugin.cpp -std=c++17 -stdlib=libc++ \
// RUN: -isysroot %sdk -I %llvm_src_root/include -I %llvm_obj_root/include -L %llvm_obj_root/lib -lLLVMSupport \
// RUN: -Wl,-undefined -Wl,suppress -Wl,-flat_namespace \
// RUN: -dynamiclib -o %t/libTestPlugin.dylib
// RUN: %target-swift-frontend -load-pass-plugin=%t/libTestPlugin.dylib %s -emit-ir -o /dev/null 2>&1 | %swift-demangle | %FileCheck %s
// CHECK: TestPlugin: main
// CHECK: TestPlugin: null.empty() -> ()
func empty() {}