2012-05-28 23:45:43 +08:00
|
|
|
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
|
2014-08-20 05:08:27 +08:00
|
|
|
; RUN: verify-uselistorder < %s
|
2012-05-28 23:45:43 +08:00
|
|
|
; PR12696
|
|
|
|
|
|
|
|
define void @f1(i8 zeroext)
|
|
|
|
; CHECK: define void @f1(i8 zeroext)
|
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f2(i8 signext)
|
|
|
|
; CHECK: define void @f2(i8 signext)
|
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f3() noreturn
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f3() #0
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f4(i8 inreg)
|
|
|
|
; CHECK: define void @f4(i8 inreg)
|
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f5(i8* sret)
|
|
|
|
; CHECK: define void @f5(i8* sret)
|
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f6() nounwind
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f6() #1
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f7(i8* noalias)
|
|
|
|
; CHECK: define void @f7(i8* noalias)
|
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f8(i8* byval)
|
|
|
|
; CHECK: define void @f8(i8* byval)
|
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f9(i8* nest)
|
|
|
|
; CHECK: define void @f9(i8* nest)
|
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f10() readnone
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f10() #2
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f11() readonly
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f11() #3
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f12() noinline
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f12() #4
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f13() alwaysinline
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f13() #5
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f14() optsize
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f14() #6
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f15() ssp
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f15() #7
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f16() sspreq
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f16() #8
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f17(i8 align 4)
|
|
|
|
; CHECK: define void @f17(i8 align 4)
|
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f18(i8* nocapture)
|
|
|
|
; CHECK: define void @f18(i8* nocapture)
|
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f19() noredzone
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f19() #9
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f20() noimplicitfloat
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f20() #10
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f21() naked
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f21() #11
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f22() inlinehint
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f22() #12
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f23() alignstack(4)
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f23() #13
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f24() returns_twice
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f24() #14
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f25() uwtable
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f25() #15
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f26() nonlazybind
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f26() #16
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
2013-02-26 14:58:09 +08:00
|
|
|
define void @f27() sanitize_address
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f27() #17
|
2012-05-28 23:45:43 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
2013-02-26 14:58:09 +08:00
|
|
|
define void @f28() sanitize_thread
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f28() #18
|
2013-02-11 16:13:54 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
2013-02-26 14:58:09 +08:00
|
|
|
define void @f29() sanitize_memory
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f29() #19
|
2013-02-11 16:13:54 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
2013-02-12 17:14:20 +08:00
|
|
|
|
|
|
|
define void @f30() "cpu"="cortex-a8"
|
2013-02-20 15:21:42 +08:00
|
|
|
; CHECK: define void @f30() #20
|
2013-02-12 17:14:20 +08:00
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
2013-07-18 06:13:44 +08:00
|
|
|
define i8 @f31(i8 returned %A)
|
|
|
|
; CHECK: define i8 @f31(i8 returned %A)
|
|
|
|
{
|
|
|
|
ret i8 %A;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f32() sspstrong
|
|
|
|
; CHECK: define void @f32() #21
|
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f33() minsize
|
|
|
|
; CHECK: define void @f33() #22
|
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @nobuiltin()
|
|
|
|
|
|
|
|
define void @f34()
|
|
|
|
; CHECK: define void @f34()
|
|
|
|
{
|
|
|
|
call void @nobuiltin() nobuiltin
|
2017-04-29 04:25:27 +08:00
|
|
|
; CHECK: call void @nobuiltin() #34
|
2013-08-23 19:53:55 +08:00
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
2013-11-19 05:44:03 +08:00
|
|
|
define void @f35() optnone noinline
|
2013-08-23 19:53:55 +08:00
|
|
|
; CHECK: define void @f35() #23
|
|
|
|
{
|
2013-07-18 06:13:44 +08:00
|
|
|
ret void;
|
2013-12-19 10:14:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @f36(i8* inalloca) {
|
|
|
|
; CHECK: define void @f36(i8* inalloca) {
|
|
|
|
ret void
|
2014-05-20 09:23:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define nonnull i8* @f37(i8* nonnull %a) {
|
|
|
|
; CHECK: define nonnull i8* @f37(i8* nonnull %a) {
|
|
|
|
ret i8* %a
|
2013-07-18 06:13:44 +08:00
|
|
|
}
|
|
|
|
|
2014-06-06 03:29:43 +08:00
|
|
|
define void @f38() unnamed_addr jumptable {
|
|
|
|
; CHECK: define void @f38() unnamed_addr #24
|
|
|
|
call void bitcast (void (i8*)* @f36 to void ()*)()
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
2014-07-18 23:51:28 +08:00
|
|
|
define dereferenceable(2) i8* @f39(i8* dereferenceable(1) %a) {
|
|
|
|
; CHECK: define dereferenceable(2) i8* @f39(i8* dereferenceable(1) %a) {
|
|
|
|
ret i8* %a
|
|
|
|
}
|
|
|
|
|
|
|
|
define dereferenceable(18446744073709551606) i8* @f40(i8* dereferenceable(18446744073709551615) %a) {
|
|
|
|
; CHECK: define dereferenceable(18446744073709551606) i8* @f40(i8* dereferenceable(18446744073709551615) %a) {
|
|
|
|
ret i8* %a
|
|
|
|
}
|
|
|
|
|
2014-07-23 00:58:55 +08:00
|
|
|
define void @f41(i8* align 32, double* align 64) {
|
|
|
|
; CHECK: define void @f41(i8* align 32, double* align 64) {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-04-17 04:29:50 +08:00
|
|
|
; CHECK: define dereferenceable_or_null(8) i8* @f42(i8* dereferenceable_or_null(8) %foo)
|
|
|
|
define dereferenceable_or_null(8) i8* @f42(i8* dereferenceable_or_null(8) %foo) {
|
|
|
|
entry:
|
|
|
|
ret i8* %foo
|
|
|
|
}
|
|
|
|
|
2015-05-27 07:48:40 +08:00
|
|
|
; CHECK: define void @f43() #25
|
|
|
|
define void @f43() convergent {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-11 18:30:36 +08:00
|
|
|
define void @f44() argmemonly
|
|
|
|
; CHECK: define void @f44() #26
|
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
2015-08-03 22:31:49 +08:00
|
|
|
; CHECK: define "string_attribute" void @f45(i32 "string_attribute")
|
|
|
|
define "string_attribute" void @f45(i32 "string_attribute") {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: define "string_attribute_with_value"="value" void @f46(i32 "string_attribute_with_value"="value")
|
|
|
|
define "string_attribute_with_value"="value" void @f46(i32 "string_attribute_with_value"="value") {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-11-06 18:32:53 +08:00
|
|
|
; CHECK: define void @f47() #27
|
|
|
|
define void @f47() norecurse {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-12-17 00:16:19 +08:00
|
|
|
; CHECK: define void @f48() #28
|
|
|
|
define void @f48() inaccessiblememonly {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: define void @f49() #29
|
|
|
|
define void @f49() inaccessiblemem_or_argmemonly {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2016-03-30 01:37:21 +08:00
|
|
|
; CHECK: define void @f50(i8* swiftself)
|
|
|
|
define void @f50(i8* swiftself)
|
|
|
|
{
|
|
|
|
ret void;
|
|
|
|
}
|
|
|
|
|
2016-04-02 05:41:15 +08:00
|
|
|
; CHECK: define i32 @f51(i8** swifterror)
|
|
|
|
define i32 @f51(i8** swifterror)
|
|
|
|
{
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: define i32 @f52(i32, i8** swifterror)
|
|
|
|
define i32 @f52(i32, i8** swifterror)
|
|
|
|
{
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
%swift_error = type {i64, i8}
|
|
|
|
declare float @foo(%swift_error** swifterror %error_ptr_ref)
|
|
|
|
|
|
|
|
; CHECK: define float @f53
|
|
|
|
; CHECK: alloca swifterror
|
|
|
|
define float @f53(i8* %error_ref) {
|
|
|
|
entry:
|
|
|
|
%error_ptr_ref = alloca swifterror %swift_error*
|
|
|
|
store %swift_error* null, %swift_error** %error_ptr_ref
|
|
|
|
%call = call float @foo(%swift_error** swifterror %error_ptr_ref)
|
|
|
|
ret float 1.0
|
|
|
|
}
|
|
|
|
|
2016-04-12 09:05:35 +08:00
|
|
|
; CHECK: define i8* @f54(i32) #30
|
|
|
|
define i8* @f54(i32) allocsize(0) {
|
|
|
|
ret i8* null
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: define i8* @f55(i32, i32) #31
|
|
|
|
define i8* @f55(i32, i32) allocsize(0, 1) {
|
|
|
|
ret i8* null
|
|
|
|
}
|
|
|
|
|
2016-07-04 16:01:29 +08:00
|
|
|
; CHECK: define void @f56() #32
|
|
|
|
define void @f56() writeonly
|
|
|
|
{
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2017-04-29 04:25:27 +08:00
|
|
|
; CHECK: define void @f57() #33
|
|
|
|
define void @f57() speculatable {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-02-12 17:14:20 +08:00
|
|
|
; CHECK: attributes #0 = { noreturn }
|
|
|
|
; CHECK: attributes #1 = { nounwind }
|
|
|
|
; CHECK: attributes #2 = { readnone }
|
|
|
|
; CHECK: attributes #3 = { readonly }
|
|
|
|
; CHECK: attributes #4 = { noinline }
|
|
|
|
; CHECK: attributes #5 = { alwaysinline }
|
|
|
|
; CHECK: attributes #6 = { optsize }
|
|
|
|
; CHECK: attributes #7 = { ssp }
|
|
|
|
; CHECK: attributes #8 = { sspreq }
|
|
|
|
; CHECK: attributes #9 = { noredzone }
|
|
|
|
; CHECK: attributes #10 = { noimplicitfloat }
|
|
|
|
; CHECK: attributes #11 = { naked }
|
|
|
|
; CHECK: attributes #12 = { inlinehint }
|
|
|
|
; CHECK: attributes #13 = { alignstack=4 }
|
|
|
|
; CHECK: attributes #14 = { returns_twice }
|
|
|
|
; CHECK: attributes #15 = { uwtable }
|
|
|
|
; CHECK: attributes #16 = { nonlazybind }
|
2013-02-26 14:58:09 +08:00
|
|
|
; CHECK: attributes #17 = { sanitize_address }
|
|
|
|
; CHECK: attributes #18 = { sanitize_thread }
|
|
|
|
; CHECK: attributes #19 = { sanitize_memory }
|
2013-02-12 17:14:20 +08:00
|
|
|
; CHECK: attributes #20 = { "cpu"="cortex-a8" }
|
2013-07-18 06:13:44 +08:00
|
|
|
; CHECK: attributes #21 = { sspstrong }
|
|
|
|
; CHECK: attributes #22 = { minsize }
|
2013-11-19 05:44:03 +08:00
|
|
|
; CHECK: attributes #23 = { noinline optnone }
|
2014-06-06 03:29:43 +08:00
|
|
|
; CHECK: attributes #24 = { jumptable }
|
2015-05-27 07:48:40 +08:00
|
|
|
; CHECK: attributes #25 = { convergent }
|
2015-07-11 18:30:36 +08:00
|
|
|
; CHECK: attributes #26 = { argmemonly }
|
2015-11-06 18:32:53 +08:00
|
|
|
; CHECK: attributes #27 = { norecurse }
|
2015-12-17 00:16:19 +08:00
|
|
|
; CHECK: attributes #28 = { inaccessiblememonly }
|
|
|
|
; CHECK: attributes #29 = { inaccessiblemem_or_argmemonly }
|
2016-04-12 09:05:35 +08:00
|
|
|
; CHECK: attributes #30 = { allocsize(0) }
|
|
|
|
; CHECK: attributes #31 = { allocsize(0,1) }
|
2016-07-04 16:01:29 +08:00
|
|
|
; CHECK: attributes #32 = { writeonly }
|
2017-04-29 04:25:27 +08:00
|
|
|
; CHECK: attributes #33 = { speculatable }
|
|
|
|
; CHECK: attributes #34 = { nobuiltin }
|