1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=ipsccp -S < %s | FileCheck %s
8 ; static ptr foo(ptr arg) { return arg; }
9 ; static ptr bar(ptr arg) { return arg; }
13 ; pthread_create(&thread, NULL, foo, NULL);
14 ; pthread_create(&thread, NULL, bar, &GlobalVPtr);
18 ; Verify the constant values NULL and &GlobalVPtr are propagated into foo and
21 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
23 %union.pthread_attr_t = type { i64, [48 x i8] }
25 @GlobalVPtr = common dso_local global ptr null, align 8
27 define dso_local i32 @main() {
30 ; CHECK-NEXT: [[THREAD:%.*]] = alloca i64, align 8
31 ; CHECK-NEXT: [[CALL:%.*]] = call i32 @pthread_create(ptr nonnull [[THREAD]], ptr null, ptr nonnull @foo, ptr null)
32 ; CHECK-NEXT: [[CALL1:%.*]] = call i32 @pthread_create(ptr nonnull [[THREAD]], ptr null, ptr nonnull @bar, ptr @GlobalVPtr)
33 ; CHECK-NEXT: ret i32 0
36 %thread = alloca i64, align 8
37 %call = call i32 @pthread_create(ptr nonnull %thread, ptr null, ptr nonnull @foo, ptr null)
38 %call1 = call i32 @pthread_create(ptr nonnull %thread, ptr null, ptr nonnull @bar, ptr @GlobalVPtr)
42 declare !callback !0 dso_local i32 @pthread_create(ptr, ptr, ptr, ptr)
44 define internal ptr @foo(ptr %arg) {
47 ; CHECK-NEXT: ret ptr [[ARG:%.*]]
53 define internal ptr @bar(ptr %arg) {
56 ; CHECK-NEXT: ret ptr [[ARG:%.*]]
62 !1 = !{i64 2, i64 3, i1 false}