1 ; RUN: opt -ipconstprop -S < %s | FileCheck %s
7 ; static void *foo(void *arg) { return arg; }
8 ; static void *bar(void *arg) { return arg; }
12 ; pthread_create(&thread, NULL, foo, NULL);
13 ; pthread_create(&thread, NULL, bar, &GlobalVPtr);
17 ; Verify the constant values NULL and &GlobalVPtr are propagated into foo and
20 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
22 %union.pthread_attr_t = type { i64, [48 x i8] }
24 @GlobalVPtr = common dso_local global i8* null, align 8
26 define dso_local i32 @main() {
28 %thread = alloca i64, align 8
29 %call = call i32 @pthread_create(i64* nonnull %thread, %union.pthread_attr_t* null, i8* (i8*)* nonnull @foo, i8* null)
30 %call1 = call i32 @pthread_create(i64* nonnull %thread, %union.pthread_attr_t* null, i8* (i8*)* nonnull @bar, i8* bitcast (i8** @GlobalVPtr to i8*))
34 declare !callback !0 dso_local i32 @pthread_create(i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)
36 define internal i8* @foo(i8* %arg) {
42 define internal i8* @bar(i8* %arg) {
44 ; CHECK: ret i8* bitcast (i8** @GlobalVPtr to i8*)
48 !1 = !{i64 2, i64 3, i1 false}