1 // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm < %s | FileCheck %s
3 // CHECK: define void @foo(i32* nonnull %x)
4 void foo(int * __attribute__((nonnull)) x) {
8 // CHECK: define void @bar(i32* nonnull %x)
9 void bar(int * x) __attribute__((nonnull(1))) {
13 // CHECK: define void @bar2(i32* %x, i32* nonnull %y)
14 void bar2(int * x, int * y) __attribute__((nonnull(2))) {
19 // CHECK: define nonnull i32* @bar3()
20 int * bar3() __attribute__((returns_nonnull)) {
24 // CHECK: define i32 @bar4(i32 %n, i32* nonnull %p)
25 int bar4(int n, int *p) __attribute__((nonnull)) {
29 // CHECK: define i32 @bar5(i32 %n, i32* nonnull %p)
30 int bar5(int n, int *p) __attribute__((nonnull(1, 2))) {
38 } TransparentUnion __attribute__((transparent_union));
40 // CHECK: define i32 @bar6(i64 %
41 int bar6(TransparentUnion tu) __attribute__((nonnull(1))) {
45 // CHECK: define void @bar7(i32* nonnull %a, i32* nonnull %b)
46 void bar7(int *a, int *b) __attribute__((nonnull(1)))
47 __attribute__((nonnull(2))) {}
49 // CHECK: define void @bar8(i32* nonnull %a, i32* nonnull %b)
50 void bar8(int *a, int *b) __attribute__((nonnull))
51 __attribute__((nonnull(1))) {}